LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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

Reply
 
LinkBack Search this Thread
Old 11-19-2012, 07:58 PM   #1
Huamin
Member
 
Registered: May 2011
Posts: 277

Rep: Reputation: Disabled
Unexpected message


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

Why?

Many Thanks & Best Regards,
HuaMin
 
Old 11-19-2012, 08:20 PM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,512
Blog Entries: 27

Rep: Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174
For the one of the reasons in the message.
 
Old 11-19-2012, 09:49 PM   #3
Huamin
Member
 
Registered: May 2011
Posts: 277

Original Poster
Rep: Reputation: Disabled
There is no one editing that. Why does the OS say it is crashed?
 
Old 11-19-2012, 11:47 PM   #4
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,614

Rep: Reputation: 164Reputation: 164
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".

Last edited by Berhanie; 11-19-2012 at 11:51 PM.
 
1 members found this post helpful.
Old 11-20-2012, 12:29 AM   #5
Huamin
Member
 
Registered: May 2011
Posts: 277

Original Poster
Rep: Reputation: Disabled
Thanks. I don't see .swp file inside the relevant folder. Where is the .swp file?

Last edited by Huamin; 11-20-2012 at 12:39 AM.
 
Old 11-20-2012, 12:49 AM   #6
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,614

Rep: Reputation: 164Reputation: 164
Quote:
Thanks. I don't see .swp file inside the relevant folder. Where is the .swp file?
the error message says the swap file is /etc/.hosts.swp. you should be able to see with "ls -a /etc". you can examine it with "less" or "cat".
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unexpected RCODE message Md.Abul Quashem Linux - Networking 2 08-22-2009 11:15 PM
Login times out while writing long message and then still can't submit message homerun LQ Suggestions & Feedback 6 08-19-2009 10:16 AM
neat command not working azx_get_response timeout message in /var/log/message ninadshaha Red Hat 1 02-19-2008 02:32 PM
GETTING "Xlib: unexpected async reply (sequence 0x9541): ERROR MESSAGE dipk_23 Programming 1 04-23-2007 06:54 AM
Strange Repeating Error message in /var/log/message lucktsm Linux - Security 2 10-27-2006 08:29 AM


All times are GMT -5. The time now is 10:57 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration