0

Need help to understand the output of ls -l command. I created one file testa in my home directory. When I run the ls -l command it shows up with two similar names. What does the symbol (~) mean with the file "testa". Below is the sample output:

testa
testa~
0

The one with tilde seems to be backup copy made by the editor you used. Most likely you can remove it safely - up to you.

Anyway

ls -l

behaves exactly as expected I'd say. For further information about ls command you should check manual:

man ls

0
ls -l

simply lists all files and folders at the current location. This includes hidden files. Hidden files usually aren't shown by file browsers (like nautilus which you probably use).

Such files start with a dot (.) or and with a tilde (~). The latter are also called backup files. They are created by most text editors (like gedit which you probably use) automatically and contain the content of the file before the last edit. So you can always go one step back.

I don't recommend it but if you want, you can disable this in gedit by going to Edit → Preferences → Editor and uncheck "Create a backup copy of files before saving".

You can also show this files in nautilus by pressing ctrl+H or going to View and check "Show Hidden Files".

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