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

简介: 当我在linux下用vi打开p1.c文件时 root@iZ2zeeailqvwws5dcuivdbZ:~/1/01/指针# vi p1.c 会出现如下信息: 1 E325: ATTENTION 2 Found a swap file by the name ".

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

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

会出现如下信息:

 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: 
上面的两段话(1)(2)的翻译是:
(1)另一个程序可能正在编辑同一个文件。 如果是这种情况,请注意在进行更改时不要以相同文件的两个不同实例结束。 退出,或继续谨慎。
(2)此文件的编辑会话崩溃。如果是这种情况,请使用“:recover”或“vim -r p1.c”来恢复更改(请参阅“:help recovery”)。如果已经这样做, 删除交换文件“.p1.c.swp”以避免此消息。

原因是我之前有一次使用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/指针# 

  

我的GitHub地址: https://github.com/heizemingjun
我的博客园地址: http://www.cnblogs.com/chenmingjun
我的蚂蚁笔记博客地址: http://blog.leanote.com/chenmingjun
Copyright ©2018 黑泽明军
【转载文章务必保留出处和署名,谢谢!】
相关文章
|
17天前
|
存储 安全 数据管理
探索Linux的挂载操作🌈
在Linux这个强大的操作系统中,挂载操作是一个基本而重要的概念。它涉及到文件系统、设备和数据访问,对于理解Linux的工作方式至关重要。那么,挂载操作究竟是什么,为什么我们需要它,如果没有它,我们将面临什么问题呢?让我们一起深入探讨。
探索Linux的挂载操作🌈
|
1天前
|
固态存储 Ubuntu Linux
Linux(29) 多线程快速解压缩|删除|监视大型文件
Linux(29) 多线程快速解压缩|删除|监视大型文件
7 1
|
1天前
|
Ubuntu Linux 数据安全/隐私保护
Linux(24) 如何在Ubuntu中操作rootfs.img文件
Linux(24) 如何在Ubuntu中操作rootfs.img文件
2 0
|
6天前
|
安全 Linux 开发工具
Linux中可引起文件时间戳改变的相关命令
【4月更文挑战第12天】Linux中可引起文件时间戳改变的相关命令
12 0
|
7天前
|
Linux Shell 开发工具
Linux文件常用操作
Linux文件常用操作(几乎覆盖所有日常使用)
81 0
|
9天前
|
Linux 内存技术 Perl
【ZYNQ】制作从 QSPI Flash 启动 Linux 的启动文件
【ZYNQ】制作从 QSPI Flash 启动 Linux 的启动文件
|
14天前
|
Linux
linux 超过4个G的文件传不上去的解决办法
linux 超过4个G的文件传不上去的解决办法
9 0
|
14天前
|
Linux 索引
linux 文件查找 和文件管理常用命令
linux 文件查找 和文件管理常用命令
22 0
|
16天前
|
Linux 开发者
Linux文件编程(open read write close函数)
通过这些函数,开发者可以在Linux环境下进行文件的读取、写入和管理。 买CN2云服务器,免备案服务器,高防服务器,就选蓝易云。百度搜索:蓝易云
84 4
|
17天前
|
监控 Linux