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