解决Swap file ".ceshi.c.swp" already exists!问题

关于swp文件:使用vi,经常可以看到swp这个文件,那这个文件是怎么产生的呢,当你打开一个文件,vi就会生成这么一个.(filename)swp文件以备不测,如果你正常退出,那么这个.(filename)swp文件将会自动删除。
因此.(filename)swp文件就是你没有正常退出vi或者vim编辑器时留下来的!比如:强行关闭vi或vim时,电源突然断掉,或者你使用了Ctrl-zz。(正常的退出方式应该是Shift-ZZ)
这时候就会出现下面的情况了
  1. <span style="font-family:SimSun;color:#ffffff;background-color: rgb(0, 0, 0);">E325: ATTENTION
  2. Found a swap file by the name ".ceshi.c.swp"
  3. owned by: root   dated: Sat Jul  4 19:51:46 2015
  4. file name: /c/ceshi.c
  5. modified: YES
  6. user name: root   host name: c66-WR
  7. process ID: 2801
  8. While opening file "ceshi.c"
  9. dated: Sun Jul  5 12:38:54 2015
  10. NEWER than swap file!
  11. (1) Another program may be editing the same file.
  12. If this is the case, be careful not to end up with two
  13. different instances of the same file when making changes.
  14. Quit, or continue with caution.
  15. (2) An edit session for this file crashed.
  16. If this is the case, use ":recover" or "vim -r ceshi.c"
  17. to recover the changes (see ":help recovery").
  18. If you did this already, delete the swap file ".ceshi.c.swp"
  19. to avoid this message.
  20. Swap file ".ceshi.c.swp" already exists!
  21. [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 ".Podfile.swp" already exists!的更多相关文章

  1. ios开发之 -- Swap file ".Podfile.swp" already exists!

  2. Git-解释“Swap file .MERGE_MSG.swp already exists”的问题

    当合并代码时非正常保存退出遇到的问题. 博客原文: https://blog.csdn.net/qq_32452623/article/details/78395832

  3. 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 ...

  4. 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就会生 ...

  5. vim编辑文件警告Swap file already exists ,如何删除vim编辑产生的.swp文件?查看隐藏文件命令

    vim编辑文件警告Swap file already exists,如何删除vim编辑产生的.swp文件?查看隐藏文件命令 Linux(centos7)下多个用户同时编辑一个文件,或编辑时非正常关闭, ...

  6. 解决Swap file &quot;.ceshi.c.swp&quot; already exists!问题

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

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

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

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

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

  9. 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 会出现如下信息: E325: ATTENTION Found ...

随机推荐

  1. window.showModalDialog刷新父窗口和本窗口的方法及注意

    window.showModalDialog刷新父窗口和本窗口的方法及注意:   一.刷新父窗口的方法:    A.使用window.returnValue给父窗口传值,然后根据值判断是否刷新. 在w ...

  2. Android数据的四种存储方式SharedPreferences、SQLite、Content Provider和File (四) —— ContentProvider

    ContentProvider是安卓平台中,在不同应用程序之间实现数据共享的一种机制.一个应用程序如果需要让别的程序可以操作自己的数据,即可采用这种机制.并且此种方式忽略了底层的数据存储实现,Cont ...

  3. Hibernate学习之延迟加载

    转自:http://www.cnblogs.com/xiaoluo501395377/p/3371776.html 在hibernate中我们知道如果要从数据库中得到一个对象,通常有两种方式,一种是通 ...

  4. Java "==和equals区别" 示例

    import java.util.Calendar; import java.util.Date; import java.util.Locale; public class test { publi ...

  5. python的虚拟运行环境

    Python 虚拟环境:Virtualenv 博客分类: Python python 在进行python开发的时候避免不同版本python或python不同版本组件之间的冲突, 有必要配置python ...

  6. android--email发送邮件,文本还有附件形式的邮件

    1.首先用的jar包为javaemail 下载地址: https://yunpan.cn/cB3kY8WIvcGtU (提取码:e042) 2.工具包 package com.kllayhello.u ...

  7. BootStrap 轮播 Carousel

    参考 http://wrongwaycn.github.io/bootstrap/docs/javascript.html#collapse 同样 启动方式有2种 一种是在div的class中加  另 ...

  8. LintCode-乱序字符串

    题目描述: 给出一个字符串数组S,找到其中所有的乱序字符串(Anagram).如果一个字符串是乱序字符串,那么他存在一个字母集合相同,但顺序不同的字符串也在S中. 注意事项 所有的字符串都只包含小写字 ...

  9. 帝国cms7.2自定义列表建立tag效果 代码 教程

    统计记录:(如:select count(*) as total from phome_ecms_news where classid=1 and checked=1) 注:这句SQL的意思是查找统计 ...

  10. C#使用WinAPI 修改电源设置,临时禁止笔记本合上盖子时睡眠

    原文 http://www.cnblogs.com/h46incon/archive/2013/09/03/3299138.html 在 阻止系统自动睡眠的小软件,附C#制作过程 ,弄了一个防止系统睡 ...