Why and how to found a swap file by the name when you edit files under Linux vi or VIM

Source: Internet
Author: User

When opening a Test.java file with VI or VIM under Linux

[Email protected] test]# VI Test.java

The following message appears:

e325: attention    found a swap file by the name  " . Test.java.swp "             owned by:  root   dated: Wed Dec  7 13:52:56 2011          file name: /var/tmp/Test.java          modified: yes         user name : root   host name: jenny          process id: 7325  (still running)     While opening file  "Test.java"            dated: Sat Jan   16 11:28:46 2016        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  Test.java "      to recover the changes  (see ": Help  recovery ").       if you did this already, delete  the swap file  ". tesT.java.swp "      to avoid this message.    " Test.java " 11l, 237c    press enter or type command to  continue

The reason is that the VI or vim before the operation of the use of VI or VIM operation Test.java file when an abnormal interruption, so in the current directory produced a. test.java.swp file, this file using the LS command to view can not be found, using LS- A command view can know that TEST.JAVA.SWP is a hidden file.

Note: Files that begin with. are hidden files

To remove the above warning prompt, delete the file:

[Email protected] test]# RM. test.java.swp


Why and how to found a swap file by the name when you edit files under Linux vi or VIM

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.