Ubuntu – What does the tilde at the end of a file name stand for


In Windows, I believe that files with a tilde in the file name represent files that are currently open in an application. For example, Microsoft Word creates a file with almost the same name as the file you currently have open, but with a tilde in the name. It's icon is also partially faded. As far as I'm aware, this signifies a temporary file that exists

  • in case the application crashes and you didn't get a chance to save your file, or
  • to allow the original file to remain unlocked by the file system and accessible to other applications.

In Linux, I ran into a *.log file with a tilde at the end of the file name (scan.log~). Does that mean the log file is currently open in another application that is potentially writing to it?

Best Answer

If a file is appended with a tilde~, it only means that it is a backup created by a text editor or similar program; it does not suggest another program is writing to that file. Besides, any file opened in vi cannot be opened in another application, but that is another discussion.

To easily find all these type of files, type cd to get to the top level of your home folder and enter:

find -type f -iname '*~'

Or, if you want to find them in a specific directory, type:

find /home/mike/Downloads -type f -iname '*~'

These files can be very useful if you happened to have edited a file and have not saved a backup of the original! Gedit, for example, creates such a backup of any file edited, although you can turn off this setting in the preferences. However, the (files~) are no substitute for a proper backup, as they might not contain the data you need, or be the version of the edit you wanted.