LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   filename ends with ~ in my home directory... (https://www.linuxquestions.org/questions/linux-newbie-8/filename-ends-with-%7E-in-my-home-directory-727531/)

jatin 05-21-2009 08:02 AM

filename ends with ~ in my home directory...
 
Dear all


I see some file like txt files ends with ~ character e.g myname.txt at the same time I see myname.txt~

why like this ??? should I remove that file to free-up the disk space


regards

colucix 05-21-2009 08:11 AM

These are backup files. They are automatically created from some editors (e.g. gedit) when you modify a file. They are the original copy without the last modification (verify using the diff command).

In gedit you can disable this feature: uncheck Edit --> Preferences --> Editor --> "Create a backup copy of files before saving".

jatin 05-21-2009 08:20 AM

Quote:

Originally Posted by colucix (Post 3548088)
These are backup files. They are automatically created from some editors (e.g. gedit) when you modify a file. They are the original copy without the last modification (verify using the diff command).

In gedit you can disable this feature: uncheck Edit --> Preferences --> Editor --> "Create a backup copy of files before saving".

Thnx for the reply.... I think I should keep it as it is ( in gedit settings ) .. ... what will happen to that file...??? file will remain forever there or will be removed by the system automatically or I've to remove that files manually to free-up some disk space


Regards

colucix 05-21-2009 08:26 AM

It will stay there forever, as any other regular file, until you remove it. If you want to remove all the backup files at once, use find:
Code:

find $HOME -type f -name \*~ -ok rm {} \;
the -ok action just asks you if you want to remove the file. If you trust the result of your find command (and you want to spare typing yes over and over) just use -exec in place of -ok and the trick is done.


All times are GMT -5. The time now is 01:34 AM.