Found a swap file by the name ".jsidInspector.py.swp"

linux下使用vim打开文件时报如下异常

E325: ATTENTION
Found a swap file by the name ".jsidInspector.py.swp"
          owned by: root   dated: Thu Jan 12 11:36:47 2017
         file name: /inspectoraccount/jsidInspector.py
          modified: YES
         user name: root   host name: localhost.localdomain
        process ID: 7084 (still running)
While opening file "jsidInspector.py"
             dated: Thu Jan 12 13:24:22 2017
      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 jsidInspector.py"
    to recover the changes (see ":help recovery").
    If you did this already, delete the swap file ".jsidInspector.py.swp"
to avoid this message.

在vim格式未保存时退出,或者两台机器同时操作一个文件时都会出现这个问题(报存在一个swap文件)
如果是多台机器同时操作一个文件,直接在另外一台机器退出即可
如果是未保存退出导致的(比如突然强制关机),首先你可以按回车什么都不干,就直接进入到了当前的文件vim模式,看看当前的文件内容是不是原先的内容,如果觉得和你想要的差不多不需要恢复,那就直接执行rm指令删除那个swap文件

 rm -rf .jsidInspector.py.swp

执行这个操作不会对你现在的文件产生影响。如果内容变化较大,你想要恢复,那就按

 :q 

先退出来,然后执行

vim -r jsidInspector.py

接着会出现要求你选择要恢复的指定文件,输入swap文件对应的数字,文件就恢复到了未保存时退出的样子。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值