When opening a Test.java file with VI or VIM under Linux
[Email protected] tmp]# VI Test.java
The following information 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: localhost process ID: 26153 (still running) While opening file "Test.java" dated: Wed dec 7 14:00:46 2011 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] tmp]# RM. Test.java.swprm:remove regular file '. Test.java.swp '? Y[[email protected] tmp]#
You can use VI or vim to edit other files in a similar manner as possible.
This article is from "I will be a Linux Expert" blog, please make sure to keep this source http://jimmyrobert.blog.51cto.com/11214519/1744646
Linux under VI or VIM operation found a swap file by the name causes and solutions