Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
When I am opening a file from Ubuntu GUI, then a similar file gets created in the same directory with a ~(tilde) at the end of the file name.
What are these files?
I am asking this because I was told that these are not the files that are supposed to be there. I was also instructed to open files through terminal only.
It's the editor creating automatic backups of your file as you edit it. Nothing to worry about, if you don't like them I'm sure your editor has a way to disable that functionality.
Emacs creates files like these as backups. But wait, it can get worse because if there's a problem, emacs creates # files. Ahhhh!!
All in all, I think several programs use the ~ symbol to designate a backup file as a protective measure for interim copies.
These files are not intended for direct use by anyone. Unfortunately they also do not get cleaned up when editors leave, especially emacs for one.
Quote:
I am asking this because I was told that these are not the files that are supposed to be there. I was also instructed to open files through terminal only.
(1) You're curious because they are there and you just weren't informed?
(2) Or you're concerned or curious because you were told that the files in particular should absolutely not be there?
The first rendition (1) would be normal and I feel you should not worry too much about them, however you can likely also delete them if you don't have any editors open. I would recommend that you just leave them there.
The second rendition (2) would not be true, no one instructing you should be telling you that you'd never encounter these files.
Emacs creates files like these as backups. But wait, it can get worse because if there's a problem, emacs creates # files. Ahhhh!!
All in all, I think several programs use the ~ symbol to designate a backup file as a protective measure for interim copies.
Yup, there are several programs that use the tilde (~) to indicate backups.
Emacs does not create a # file if there is a problem. It is always created. The "#" prefix and sufix with emacs is for the autosave feature. When the original file is saved, that file *should* be deleted. If not, the next time the user opens that file emacs assumes it crashed last time around, and the user is prompted asking if they want to load the "recovered" data.
It's the editor creating automatic backups of your file as you edit it. Nothing to worry about, if you don't like them I'm sure your editor has a way to disable that functionality.
How can I tell the editor to stop making these backup files? Is there any command that needs to be run from the terminal?
Emacs creates files like these as backups. But wait, it can get worse because if there's a problem, emacs creates # files. Ahhhh!!
All in all, I think several programs use the ~ symbol to designate a backup file as a protective measure for interim copies.
These files are not intended for direct use by anyone. Unfortunately they also do not get cleaned up when editors leave, especially emacs for one.(1) You're curious because they are there and you just weren't informed?
(2) Or you're concerned or curious because you were told that the files in particular should absolutely not be there?
The first rendition (1) would be normal and I feel you should not worry too much about them, however you can likely also delete them if you don't have any editors open. I would recommend that you just leave them there.
The second rendition (2) would not be true, no one instructing you should be telling you that you'd never encounter these files.
Mine was the second case. Looks like the guy who forbade me to remove ~ files said this because he did not want those files or at least that clutter when ls command is run.
the very FIRST time you edit a system file and royally mess it up and the Operating System will no longer BOOT
is the VERY LAST time you will stop NOT having back up files and turn that ~ back on
using "mv" to move that BACK UP config file to the original file is a LOT easier than trying to REMEMBER!!! what you did to a system file using "vi" or "nano"
the very FIRST time you edit a system file and royally mess it up and the Operating System will no longer BOOT
is the VERY LAST time you will stop NOT having back up files and turn that ~ back on
using "mv" to move that BACK UP config file to the original file is a LOT easier than trying to REMEMBER!!! what you did to a system file using "vi" or "nano"
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.