This question already has an answer here:

What is the file with the ~ at the end of the filename for?

$ ls # aliased to add flags
-rwxrwxr-x  1 durrantm  2741 May 16 09:28 strip_out_rspec_prep_cmds.sh~*
drwxrwxr-x 13 durrantm  4096 May 16 14:21 ../
-rwxrwxr-x  1 durrantm  2221 May 16 14:58 strip_out_rspec_prep_cmds.sh*

This is not the same as .swp files which are there while editing.

The two files have quite a few differences and the newer file (no ~ at the end) has the most recent changes and those changes are not in the older (~) file.

Looks like I can delete it?

marked as duplicate by Mikel, slm, Michael Mrozek May 17 '13 at 14:33

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


Typically files ending with a ~ are backups created by editors like emacs, nano or vi.

  • OP asks what ~ means, not what programs might create such files. Please elaborate on what is the purpose of such files. – SkyDan Jun 9 '14 at 12:43

A tilde suffix is usually used for backup files. Vim and Emacs use this convention and probably many other programs, too. .swp files are vim swap files which are only present during editing of a file or in the case vim crashed.

Not the answer you're looking for? Browse other questions tagged or ask your own question.