Linux modified the file when the crash, produced a. swap file, how to fix it?

Source: Internet
Author: User

Sometimes when you open a file with Vim, you are prompted with information similar to the following:

E325: note
Discovery Interchange File ". Exportcert.cpp.swp"
Owner: Liuchuanliang Date: Thu Mar 1 17:15:41 2012
File name: ~liuchuanliang/ftsafe/entersafe-shuttle-linux-111114/i386/sample2/source/exportcert/exportcert.cpp
Modified: Yes
User name: Liuchuanliang host Name: Liuchuanliang-desktop
Process id:4434
Opening file "Exportcert.cpp"
Date: Thu Mar 8 10:56:17 2012
Newer than swap files!

(1) Another program may also be editing the same file.
If so, be careful to avoid creating two different versions of the same file when you modify it.

Exit, or proceed with caution.

(2) Crash when this file was last edited.
If this is the case, please use ": Recover" or "vim-r exportcert.cpp"
Restore the modified content (see ": Help Recovery").
If you have already recovered,to avoid seeing this message again.

Interchange file ". EXPORTCERT.CPP.SWP" already exists!
Open as read-only ([O]), direct edit ((E)), Restore ((R)), Delete interchange File ((D)), Exit ((Q)), Abort ((A)):

This is because when you open a file with Vim, It will produce a filename.swap file for saving the data, when the file is not properly closed, the file can be used to recover, when the normal shutdown, the file will be deleted, abnormal shutdown, will not be deleted, so there is a. swap file, you can restore the file:

Vim-r filename.c

After the recovery, delete the. swap file, and when you open it, do not use the prompt, note that the. swap file is a hidden file. Available: La view. The. begins with a hidden file.

Linux modified the file when the crash, produced a. swap file, how to fix it?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.