我在 vi 中打开了一个文件,但不幸的是,在更改它时终端崩溃了。现在,当我尝试在新的会话中再次打开同一个文件时,它会显示以下消息
E325: ATTENTION
Found a swap file by the name ".searchRefineVertTabs.jsp.swp"
owned by: nextag dated: Tue Mar 5 03:30:12 2013
file name: ~nt/deploy/main/main.build.3616.BR_PS_1109.2239/..../searchRefineVertTabs.jsp
modified: YES
user name: nextag host name: li1
process ID: 9241
While opening file "searchRefineVertTabs.jsp"
dated: Tue Mar 5 03:35:51 2013
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 searchRefineVertTabs.jsp"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file ".searchRefineVertTabs.jsp.swp"
to avoid this message.
我想知道如何删除这个 .swp 文件。我在路径 filepath/...../outpdir1 上找不到它`
答案1
在出现警报期间,您可以按D。或者查看本地计算机上的当前目录。
编辑:您还可以使用以下方法搜索文件:
find | grep ".searchRefineVertTabs.jsp.swp"
答案2
.swp 文件将在原始文件所在的位置生成。因此只需删除该文件即可。
假设你有文件.txt在/usr/本地/src/,那么你的.文件.txt.swp文件将创建于/usr/本地/src/。
只需将其删除然后打开原始文件。它不会为您提供只读,编辑等选项。