linux下对于打开意外退出的文档报错解决方法

一、报错信息

E325: 注意
发现交换文件 ".xsnq.txt.swp"
            所有者: root    日期: Fri Dec 25 16:45:28 2020
            文件名: ~root/xsnq.txt
            修改过: 是
            用户名: root      主机名: localhost.localdomain
           进程 ID: 4976
正在打开文件 "xsnq.txt"
              日期: Fri Dec 25 16:45:05 2020

(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.
    如果是这样,请用 ":recover""vim -r xsnq.txt"
    恢复修改的内容 (请见 ":help recovery")。
    如果你已经进行了恢复,请删除交换文件 ".xsnq.txt.swp"
    以避免再看到此消息。

交换文件 ".xsnq.txt.swp" 已存在!
以只读方式打开([O]), 直接编辑((E)), 恢复((R)), 删除交换文件((D)), 退出((Q)), 中止((A)):

二、解决方法

文件内容恢复到最后一次保存的状态

1.查看意外退出产生的文件

# ls -la  或 # find . -name *.swp
-rw-r--r--.  1 root   root      12288 12月 25 16:45 .xsnq.txt.swp

2.删除后缀为.swp的文件

# rm -rf .xsnq.txt.swp   //针对单个文件# find . -name *.swp -exec rm -rf {} \;   //真对所有后缀为.swp的文件

本文若出现任何错误,请留言批评指正。

猜你喜欢

转载自blog.csdn.net/weixin_46623617/article/details/111690878