Vi File crashed

How do I correct this?....I can not find the swp.
I performed the vim -r hosts.cfg...but I keep getting this error?

Found a swap file by the name ".hosts.cfg.swp"
owned by: root dated: Tue Mar 25 22:23:17 2008
file name:/usr/local/nagios/etc/objects/hosts.cfg
modified: YES
user name: root host name:
process ID: 12775
While opening file hosts.cfg"
dated: Wed Apr 9 14:55:48 2008
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 hosts.cfg"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file ".hosts.cfg.swp"
to avoid this message.
"hosts.cfg.swp" 579L, 256C
Press ENTER or type command to continue
Who is Participating?
dipopoConnect With a Mentor Commented:
try this:


locate hosts.cfg.swp
Sanga CollinsSystems AdminCommented:
You can do

# find . -name .hosts.cfg.swap

This will tell you the location of the swap file to delete.
Seth SimmonsSr. Systems AdministratorCommented:
.hosts.cfg.swap should either be in /tmp or /usr/local/nagios/etc/objects
make sure you do -a with ls so you can see the file since it's hidden
gumball60Author Commented:
right on
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.