关于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. Git_自定义Git

    在安装Git一节中,我们已经配置了user.name和user.email,实际上,Git还有很多可配置项. 比如,让Git显示颜色,会让命令输出看起来更醒目: $ git config --glob ...

  2. 嵌入式设备hacking(转)

    原帖地址:http://drops.wooyun.org/papers/5157 0x00 IPCAM hacking TOOLS github-binwalk firmware-mod-kit ID ...

  3. hdu2158

    最短区间版大家来找碴 Time Limit: 5000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total ...

  4. Swift之沙盒与数据存储

    应用沙盒结构分析 1.应用程序包:包含了所有的资源文件和可执行文件 2.Documents:保存应用运行时生成的需要持久化的数据,iTunes同步设备时会备份该目录 3.tmp:保存应用运行时所需要的 ...

  5. 01使用ILDasm.exe将可执行文件反编译成IL代码

    控制台代码 using System;   namespace ConsoleApplication1 { class Program { static void Main(string[] args ...

  6. Hadoop-2.2.0中文文档——Common-Hadoop HTTP web控制台认证

    简单介绍 此文档描写叙述了怎样配置Hadoop HTTP web控制台,去要求用户认证. 默认地,Hadoop HTTP web控制台(JobTracker, NameNode, TaskTracke ...

  7. @JVM中对象的引用类型

    JVM中有四种引用类型:强引用.软引用.弱引用.虚引用   强引用(Stong Reference):是指在程序代码中普遍存在的,类似:Object obj = new Object()这类的引用,只 ...

  8. Rabbit MQ UI 重置 用户名 密码

    新增admin用户 rabbitmqctl add_user newadmin s0m3p4ssw0rd rabbitmqctl set_user_tags newadmin administrato ...

  9. JS中应用正则表达式转换大小写

    JS中应用正则表达式转换大小写,代码很简单,看代码: 以下首字母大写,其它字母小写 <script type="text/javascript"> function r ...

  10. IOS中Key-Value Coding (KVC)的使用详解

    kvc,键值编码,是一个非正式的协议,它提供一种机制来间接访问对象的属性.直接访问对象是通过调用访问器的方法实现,而kvc不需要调用访问器的设置和获取方法,可以直接访问对象的属性. 下面介绍一下kvc ...