What does a ~ mean after a file name in UNIX (bash)?
5,377
Solution 1
This is just a convention to indicate a backup file.
Solution 2
it is used to indicate the backup file. even in Microsoft office products when you open any file, same file is created with same name beginning with ~
but it is hidden.
Related videos on Youtube
Author by
ask
Updated on September 18, 2022Comments
-
ask over 1 year
When I create a file using vim and save it, for eg. main.c, two copies are created: main.c and main.c~. They have the same contents. Why is this happening and what does the ~ mean?
-
Felix over 11 yearsThis might help: stackoverflow.com/a/4234221/218196.
-
-
Admin over 11 yearsWhat should I do about it? I don't want a separate backup file to be present when I commit stuff using git.
-
Admin over 11 yearsCreate a .gitignore file and add
*~
to it. -
Admin over 11 yearsYou can also turn this off in
vim
- see thebackup
andwritebackup
options