vi操作异常时Found a swap file by the name

简介:

当我在linux下用vi打开Test.java文件时

[root@localhost tmp]# vi Test.java

会出现如下信息:


Dos代码  收藏代码

  1. E325: ATTENTION  

  2. Found a swap file by the name ".Test.java.swp"  

  3.   

  4.          owned by: root   dated: Wed Dec  7 13:52:56 2011  

  5.          file name: /var/tmp/Test.java  

  6.          modified: YES  

  7.          user name: root   host name: localhost  

  8.          process ID: 26153 (still running)  

  9. While opening file "Test.java"  

  10.              dated: Wed Dec  7 14:00:46 2011  

  11.       NEWER than swap file!  

  12.   

  13. (1) Another program may be editing the same file.  

  14.     If this is the case, be careful not to end up with two  

  15.     different instances of the same file when making changes.  

  16.     Quit, or continue with caution.  

  17.   

  18. (2) An edit session for this file crashed.  

  19.     If this is the case, use ":recover" or "vim -r Test.java"  

  20.     to recover the changes (see ":help recovery").  

  21.     If you did this already, delete the swap file ".Test.java.swp"  

  22.     to avoid this message.  

  23. "Test.java" 11L, 237C  

  24. Press ENTER or type command to continue  

 

原因是我之前有一次使用vi 操作Test.java文件时出现了异常中断,所以在当前目录下产生了一个.Test.java.swp文件

但是我使用ls命令查看该目录下,却发现没有这个文件,后来使用ls -a命令查看才知道Test.java.swp是一个隐藏文件。

注:以.开头的文件就是隐藏文件

当我把该隐藏文件删除后再次打开就没有上面的警告了。

[root@localhost tmp]# rm .Test.java.swp

rm: remove regular file `.Test.java.swp'? y

[root@localhost tmp]# 



     本文转自韩立伟 51CTO博客,原文链接:http://blog.51cto.com/hanchaohan/1916699,如需转载请自行联系原作者



相关文章
|
18天前
|
Linux Shell 开发工具
linux编辑文件出现write.error.(file.system.full?)
linux编辑文件出现write.error.(file.system.full?)
11 1
|
6月前
|
Shell Linux 开发工具
【异常解决】vim编辑文件时提示 Found a swap file by the name “.start.sh.swp“的解决方案
【异常解决】vim编辑文件时提示 Found a swap file by the name “.start.sh.swp“的解决方案
91 0
|
6月前
|
前端开发
【前端异常】Module build failed: Error: ENOENT: no such file or directory, scandir ‘G:\OPWeb\public\node_m
【前端异常】Module build failed: Error: ENOENT: no such file or directory, scandir ‘G:\OPWeb\public\node_m
68 0
|
8月前
|
Ubuntu Linux
No manual entry for ls解决办法
No manual entry for ls解决办法
|
10月前
|
监控 Linux
Linux ls 命令提示 Input/output error
Linux ls 命令提示 Input/output error
372 0
|
Ubuntu JavaScript
ubuntu 文件监视数量 Error: ENOSPC: System limit for number of file watchers reached, watch‘所在文件路径‘
vue 运行执行 npm run dev | * Error: ENOSPC: System limit for number of file watchers reached, watch’所在文件路径’ 最简单的命令 沾走就能用
131 0
ubuntu 文件监视数量 Error: ENOSPC: System limit for number of file watchers reached, watch‘所在文件路径‘
Can‘t read file : End of file found 文件:txn_current、current svn无法正常读取文件
Can‘t read file : End of file found 文件:txn_current、current svn无法正常读取文件
Can‘t read file : End of file found 文件:txn_current、current svn无法正常读取文件
|
Linux
Linux 格式化分区 报错Could not stat --- No such file or directory 和 partprobe 命令
分区的过程正常: [root@db1 /]# fdisk -l   Disk /dev/sda: 21.4 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 160...
1309 0
E297: Write error in swap file
当我使用vim编辑一个常用的配置文件的时候出现一个错误: E297: Write error in swap file 然后上网查找原因,说是磁盘空间不足,于是我就查看一下机器磁盘空间使用情况: sht-sgmhadoopdn-02:postgres:/usr/loca...
2412 0