前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >linux下vi编辑某文件时,操作出现 错误提示: E325: ATTENTION 2, Found a swap file by the name ".p1.c.swp"

linux下vi编辑某文件时,操作出现 错误提示: E325: ATTENTION 2, Found a swap file by the name ".p1.c.swp"

作者头像
黑泽君
发布2018-10-11 16:10:06
3.3K0
发布2018-10-11 16:10:06
举报
文章被收录于专栏:黑泽君的专栏

当我在linux下用vi打开p1.c文件时

root@iZ2zeeailqvwws5dcuivdbZ:~/1/01/指针# vi p1.c

会出现如下信息:

代码语言:javascript
复制
 1 E325: ATTENTION
 2 Found a swap file by the name ".p1.c.swp"
 3           owned by: root   dated: Fri Jan  5 19:57:58 2018
 4          file name: ~root/1/01/指针/p1.c
 5           modified: YES
 6          user name: root   host name: iZ2zeeailqvwws5dcuivdbZ
 7         process ID: 10876
 8 While opening file "p1.c"
 9              dated: Fri Jan  5 19:51:30 2018
10 
11 (1) Another program may be editing the same file.  If this is the case,
12     be careful not to end up with two different instances of the same
13     file when making changes.  Quit, or continue with caution.
14 (2) An edit session for this file crashed.
15     If this is the case, use ":recover" or "vim -r p1.c"
16     to recover the changes (see ":help recovery").
17     If you did this already, delete the swap file ".p1.c.swp"
18     to avoid this message.
19 
20 Swap file ".p1.c.swp" already exists!
21 [O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort: 

原因是我之前有一次使用vi 操作 p1.c 文件时出现了异常中断,与服务器中断连接了,所以我重新连接服务器后,用 i p1.c 查看时,在当前目录下产生了一个 .p1.c.swp 文件。

但是我使用ls命令查看该目录下,却发现没有这个文件,后来使用ls -a命令查看才知道 .p1.c.swp 是一个隐藏文件。

注:以.开头的文件就是隐藏文件哦。

当我把该隐藏文件删除后再次打开就没有上面的警告了。

root@iZ2zeeailqvwws5dcuivdbZ:~/1/01/指针# rm .p1.c.swp

root@iZ2zeeailqvwws5dcuivdbZ:~/1/01/指针# 

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2018-01-06 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档