出于某种原因,当我尝试编辑时vi .profile,终端一直告诉我我已经在编辑模式下拥有 .profile 。
E325: ATTENTION
Found a swap file by the name ".profile.swp"
owned by: smaranh dated: Fri Apr 6 09:46:45 2012
file name: ~smaranh/.profile
modified: YES
user name: smaranh host name: ubuntu
process ID: 4394
While opening file ".profile"
dated: Fri Apr 27 10:35:32 2012
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 .profile"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file ".profile.swp"
to avoid this message.
".profile" 23 lines, 713 characters
Press ENTER or type command to continue
Run Code Online (Sandbox Code Playgroud)
所以我试图终止上面消息显示的进程,但它一直显示No such process.
然后我使用ps -ef | grep 4394并得到了这个输出,
smaranh 3491 3375 0 10:08 pts/3 00:00:00 grep --color=auto 4394
Run Code Online (Sandbox Code Playgroud)
所以我试过了,kill -9 3491但它仍然给了我No such process。不知道出了什么问题?
如何关闭已经打开的.profile?
Eri*_*lho 16
这是一个旧的交换文件,它仍然存在,因为编辑器可能崩溃或已被杀死。您可以安全地擦除它。
rm .profile.swp
Run Code Online (Sandbox Code Playgroud)