关于swp文件:使用vi,常常能够看到swp这个文件,那这个文件是怎么产生的呢。当你打开一个文件,vi就会生成这么一个.(filename)swp文件以备不測,假设你正常退出,那么这个.(filename)swp文件将会自己主动删除。

因此.(filename)swp文件就是你没有正常退出vi或者vim编辑器时留下来的!

比方:强行关闭vi或vim时。电源突然断掉,或者你使用了Ctrl-zz。(正常的退出方式应该是Shift-ZZ)

这时候就会出现以下的情况了
<span style="font-family:SimSun;color:#ffffff;background-color: rgb(0, 0, 0);">E325: ATTENTION
Found a swap file by the name ".ceshi.c.swp"
owned by: root dated: Sat Jul 4 19:51:46 2015
file name: /c/ceshi.c
modified: YES
user name: root host name: c66-WR
process ID: 2801
While opening file "ceshi.c"
dated: Sun Jul 5 12:38:54 2015
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 ceshi.c"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file ".ceshi.c.swp"
to avoid this message. Swap file ".ceshi.c.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit:</span>


重点:解决的方法



  用以下的命令删除swp文件

rm .{your file name}.swp

比如:我的文件名称是ceshi.c 那么就用这种命令:rm .ceshi.c.swp (当然你前面也能够加-rf强制删除)

问: (vi 一个文件时怎么样能够不让它产生.swp文件?或不让他提示【“Swap file ".文件名称.swp" already exists![O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit:】)



处理方法: 打开 vi /etc/vimrc 并在末尾加入 set noswapfile 后保存退出 OK

解决Swap file &quot;.ceshi.c.swp&quot; already exists!问题的更多相关文章

  1. 解决 swap file “*.swp”already exists!问题

     用vim编辑文件实际上是先copy一份临时文件,病映射到内存给你编辑,编辑的是临时文件,当执行:w后才保存临时文件到原文件,执行:q后才删除临时文件. 每次启动检索是否有临时文件,有就询问如何处理, ...

  2. iOS开发之--解决 swap file “*.swp”already exists!问题

    刚才我在vim导入第三方库的时候,突然发现我把podfile的名字打错了,然后我直接终止了进程,然后你懂得出错了,,E325......., 其实使用vim编辑文件实际上是先copy一份临时文件,病映 ...

  3. Swap file ".BranchModel.class.php.swp" already exists!

    在 Linux 下的 vim 编辑过程中,由于某种原因异常退出正在编辑的文件,再次编辑该文件时,会出现如下提示: 1.解决方法:直接 ll -a -a 列出目录下的所有文件,包括以 . 开头的隐含文件 ...

  4. Swap file ".Podfile.swp" already exists!

    解决Swap file ".ceshi.c.swp" already exists!问题 关于swp文件:使用vi,经常可以看到swp这个文件,那这个文件是怎么产生的呢,当你打开一 ...

  5. vim编辑时遇到E325: ATTENTION Found a swap file by the name "./.backu.sh.swp"错误代码的解决办法

    vim编辑时遇到E325: ATTENTION Found a swap file by the name "./.backu.sh.swp"错误代码的解决办法 重点:解决方法是: ...

  6. swap file "*.swp" already exists!的解决方法

    Linux下编程难免要开启多个vim共同编辑同一个文件,这时再次保存就会出现: swap file "*.swp" already exists! [O]pen Read-Only ...

  7. iOS开发之Found a swap file by the name ".podfile.swp" owned by: Netban dated:...file name: ~N...

    Found a swap file by the name ".podfile.swp" owned by: Netban dated: Fri Mar 24 13:57:27 2 ...

  8. Swap file "/etc/.hosts.swp" already exists! [O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it,

    非正常关闭vi编辑器时会生成一个.swp文件 非正常关闭vi编辑器时会生成一个.swp文件 关于swp文件 使用vi,经常可以看到swp这个文件,那这个文件是怎么产生的呢,当你打开一个文件,vi就会生 ...

  9. linux进行文件vim编辑时没有退出文件直接关闭出现E325: ATTENTION Found a swap file by the name "/usr/local/php/etc/.php.ini.swp"

    E325: ATTENTIONFound a swap file by the name "/usr/local/php/etc/.php.ini.swp"          ow ...

随机推荐

  1. CGI 、PHP-CGI、FASTCGI、PHP-FPM

    CGI是干嘛的? CGI是为了保证web server传递过来的数据是标准格式的,方便CGI程序的编写者.web server(比如说nginx)只是内容的分发者.比如,如果请求的是/index/ht ...

  2. java的(PO,VO,TO,BO,DAO,POJO)解释1

    java的(PO,VO,TO,BO,DAO,POJO)解释  O/R Mapping 是 Object Relational Mapping(对象关系映射)的缩写.通俗点讲,就是将对象与关系数据库绑定 ...

  3. Linux下的两个经典宏定义 转

    http://www.linuxidc.com/Linux/2016-08/134481.htm http://www.linuxidc.com/Linux/2013-01/78003.htm htt ...

  4. Nucleus PLUS任务调度

    概述 Nucleus Plus内核(Kernel)的主要目的是管理实时任务的竞争执行(共享CPU),为应用提供各种便利,高速响应外部事件.Nucleus Plus的系统结构如图1所看到的,能够看出线程 ...

  5. linux shell if语句使用方法

    原文地址:http://blog.chinaunix.net/uid-24607609-id-2118151.html 最精简的 if 命令的语法是: if TEST-COMMANDS; then C ...

  6. SimpleDateFormat in Java is not Thread-Safe Use Carefully

    SimpleDateFormat in Java  very common and used to format Date to String and parse String into Date i ...

  7. Android的基本常用的短信操作

    1.调用系统发送短信界面(传入手机号码+短信内容) 2.隐藏发送短信(指定号码指定内容)(这里隐藏只是没有反写入数据库) 3.获得收件箱接收到的短信 4.Android屏蔽新短信通知提示信息:(Con ...

  8. python接口自动化27-urlencode编码%E6%82%A0%E6%82%A0与解码

    前言 urllib.parse 里面三个方法:urlencode,quote,unquote详解. 在做接口自动化过程中,http协议在发送url的时候,是以urlencode的编码格式传过去的,通常 ...

  9. java使用POI获取sheet、行数、列数

    FileInputStream inp = new FileInputStream("E:\\WEIAN.xls"); HSSFWorkbook wb = new HSSFWork ...

  10. [Git] 写文章 史上最全文献检索、阅读及管理攻略

    copy from  : https://zhuanlan.zhihu.com/p/30605683 一.查文献 首先,我认为需要常备几个体量大.文献全的数据库,有针对性找哦!下面列出了一些适合所有专 ...