Results 1 to 6 of 6

Thread: Files ending in a tilde (~) ?

  1. #1
    Join Date
    Jul 2007
    Beans
    32

    Files ending in a tilde (~) ?

    Hey everyone,

    I have noticed that a TON of files that I have used, created or edited on Ubuntu 8.1 (with gedit mostly) have a version with a tilde at the end of them. For example:

    something.html
    something.html~
    foobar.txt
    foobar.txt~

    This is a bit strange and does not seem right to me, is this normal or do I have something going on with my system? Is there a way around having these files created?

    Thanks for any help

  2. #2
    Join Date
    Jul 2007
    Location
    UK
    Beans
    17,059
    Distro
    Ubuntu Development Release

  3. #3
    Join Date
    Feb 2008
    Location
    52°38'41.6"N/1°19'43.6"E
    Beans
    Hidden!

    Re: Files ending in a tilde (~) ?

    Files ending in tilde "~" are backup files created when you edit an existing file in most applications.

    Most of the time it is safe to remove them as they'll be obsolete, but they can be handy if you need to revert to the previously saved file.

    Edit: beat me to it

  4. #4
    Join Date
    Jul 2007
    Beans
    32

    Re: Files ending in a tilde (~) ?

    Oh Ok well that makes a bit of sense

    Its sort of strange that the files sit around even after the file is saved though...

    Thanks for the info!

  5. #5
    Join Date
    Jun 2006
    Location
    The Netherlands
    Beans
    2,185
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Files ending in a tilde (~) ?

    The file with the tilde is the previous version of the file (the version before the last time you saved it). It's there so that if you edit something wrong and you want to get the previous version back, you still have it. It wouldn't make sense if it would be deleted if you save the file...

    If you are sure your edits are OK and you don't need the old version anymore, you can safely delete the tilde files.
    Ubuntu 12.04

  6. #6
    Join Date
    Feb 2008
    Location
    52°38'41.6"N/1°19'43.6"E
    Beans
    Hidden!

    Re: Files ending in a tilde (~) ?

    I run the following to move tilde files from my home directory to the trash:

    Code:
    find ~/ -type f -iname "*~" -print0 | xargs -0 sudo mv -fv --target-directory=/home/USERNAME/.local/share/Trash/files/
    Just change the username to suit...

    Just thought it might be useful to you

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •