解决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

最新文章

  1. adb push命令的使用
  2. requirejs+cdn
  3. https_request
  4. Java的浮点数和整数的进制转换
  5. Entity Framework中编辑时错误ObjectStateManager 中已存在具有同一键的对象
  6. 错误 1 在应用程序级别之外使用注册为 allowDefinition=&#39;
  7. VopSdk一个高逼格微信公众号开发SDK:自动化生产(装逼模式开启)
  8. werkzeug(flask)中的local,localstack,localproxy探究
  9. DotNetCore跨平台~聊聊中间件
  10. 2019-04-29 EasyWeb下配置Atomikos+SQLServer分布式数据源
  11. mysql之数据备份与恢复
  12. 【kindle笔记】之 《鬼吹灯》-9-20
  13. openssl中RSA数字签名的使用
  14. 【慕课网实战】Spark Streaming实时流处理项目实战笔记十七之铭文升级版
  15. CF 449D 题解(状压+容斥)
  16. centos crontab 计划任务 设置与查看
  17. jqGrid动态增加列,使用在根据条件筛选而出现不同的列的场景
  18. yarn基础架构
  19. PHP双引号的隐患
  20. SSH免密码远程登录Linux

热门文章

  1. [置顶] 内存映射失败MapViewOfFile 失败 返回 8
  2. BootStrap 智能表单系列 六 表单数据绑定(编辑页面的数据绑定)
  3. POJ 3974 Palindrome(最长回文子串)
  4. 关于js的一些关键知识点(call,apply,callee, caller,clourse,prototypeChain)
  5. (C#)Windows Shell 编程系列3 - 上下文菜单(iContextMenu)(一)右键菜单
  6. Angulajs 表单的ng-model绑定
  7. IOS_OC_id ,NSObject, id&amp;lt;NSObject&amp;gt;差别
  8. Ext JS学习第二天 我们所熟悉的javascript(一)
  9. 修改页面中所有TextBox控件的样式--CSS
  10. for语句的嵌套(示例及练习)