Many Unix/Linux systems programs create backup files that end in ~.
For example, the emacs and nano editors automatically save a backup copy of each file you edit. When it saves a file, the old version gets saved using the file name with a tilde (~) added to the end.
Vim will do the same if you put :set backup in your .vimrc.
You are removing a file with an & character in the name, and the rm command is being put in the background. (For the record, the 1 is the job number, and the 12345 is the process ID)
It is important to quote or escape any filenames that contain special characters. A good rule of thumb is: if you think something might be a special character, it can't hurt to quote. Just put 'single quotes' around the whole filename, unless it contains a single quote mark - then it gets more complicated. You could also (instead of quotes) put a backslash \ before every special character (including any backslashes the filename may contain) Though, if you tab-complete the shell will quote or escape anything that actually is a special character for you.
In this case, it means ‘standard input’. It's used by some software (e.g. tar) when a file argument is required and you need to use stdin instead. It's not a shell construct and it depends on the program you're using. Check the manpage if in doubt!
In this instance, standard input is the argument to the -f option. In cases where - isn't supported, you can get away with using something like tar xvf /proc/self/fd/0 or tar xvf /dev/stdin (the latter is widely supported in various unices).
Don't rely on this to mean ‘standard input’ universally. Since it's not interpreted by the shell, every program is free to deal with it as it pleases. In some cases, it's standard output or something entirely different: on su it signifies ‘start a login shell’. In other cases, it's not interpreted at all. Muscle memory has made me create quite a few files named - because some version of some program I was used to didn't understand the dash.
Best Answer
It's basically removing backup files.
*~
means all files ending in~
.Many Unix/Linux systems programs create backup files that end in
~
.For example, the
emacs
andnano
editors automatically save a backup copy of each file you edit. When it saves a file, the old version gets saved using the file name with a tilde (~
) added to the end.Vim
will do the same if you put:set backup
in your.vimrc
.*~
on Unix/Linux is like*.bak
on Windows.