Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Hi,
When use vi to edit any one file, I get this
E325: ATTENTION
Found a swap file by the name "/etc/.hosts.swp"
owned by: root dated: Fri Nov 16 09:25:07 2012
file name: /etc/hosts
modified: no
user name: root host name: localhost.localdomain
process ID: 4126
While opening file "/etc/hosts"
dated: Mon Nov 19 23:37:42 2012
NEWER than swap file!
(1) Another program may be editing the same file.
If this is the case, be careful not to end up with two
different instances of the same file when making changes.
Quit, or continue with caution.
(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r /etc/hosts"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file "/etc/.hosts.swp"
to avoid this message.
"/etc/hosts" 4L, 192C
Press ENTER or type command to continue
it's possible that you did not exit the editor properly, so that the .swp file was not deleted. one reason for this may be that you accidentally hit ctrl-z (suspend process) while editing a file. this is a common problem, as i've observed, with people new to linux. you can see your suspended jobs with the "jobs" command, and can un-suspend the last job by putting it in the foreground again with the "fg" command. this all needs to happen before you log out and thereby (probably) kill those jobs.
if you cannot resume your editing session as above, you can follow the the instructions of the error message, and attempt to recover your changes with "vi -r", or just remove the .swp file (with "rm /path/to/.swp/file") and work with the file that you have saved.
in future, you might make the subject of your thread more descriptive, e.g. "vim swap file prevents editing" rather than "unexpected message".
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.