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?
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 invi
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:Or, if you want to find them in a specific directory, type:
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.Some text editors (such as
emacs
) create a backup of the file you are editing, and give the backup file the name of the original file plus a tilde. The file you describe might be the result of openingscan.log
with such a text editor and making some change.You can use
fuser
(see Ubuntu packagepsmisc
) to see if a process currently has that file open:fuser scan.log~