Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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.

Related: askubuntu.com/questions/173151/… – Evan Teitelman May 17 '13 at 13:17
This is a more canonical (clear, concise, and less localized) Q&A than the duplicate therefore should be reopened to replace it. See: meta.unix.stackexchange.com/questions/2840/… – goldilocks Apr 24 '14 at 16:31
up vote 12 down vote accepted

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

share|improve this answer
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.

share|improve this answer

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