linux下vi或vim操作Found a swap file by the name的原因及解决方法--九五小庞

在linux下用vi或vim打开Test.java文件时

root@localhost tmp\]# vi Test.java 出现了如下信息: E325: ATTENTION Found a swap file by the name ".Test.java.swp" owned by: root dated: Wed Dec 7 13:52:56 2011 file name: /var/tmp/Test.java modified: YES user name: root host name: localhost process ID: 26153 (still running) While opening file "Test.java" dated: Wed Dec 7 14:00:46 2011 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 Test.java" to recover the changes (see ":help recovery"). If you did this already, delete the swap file ".Test.java.swp" to avoid this message. "Test.java" 11L, 237C Press ENTER or type command to continue 原因是在此次vi或vim操作前有过一次使用vi或vim 操作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\]# 使用vi或vim编辑其他文件出现类似情况的处理方法一样可以。 ------------------------------------------------ 版权声明:本文为CSDN博主「kenhins」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/kenhins/article/details/50781071

相关推荐
程序员小远14 分钟前
银行测试:第三方支付平台业务流,功能/性能/安全测试方法
自动化测试·软件测试·python·功能测试·测试工具·性能测试·安全性测试
IT成长日记41 分钟前
【Nginx开荒攻略】Nginx虚拟主机配置:从域名、端口到IP的完整指南
linux·运维·服务器·nginx·虚拟主机
taxunjishu1 小时前
DeviceNet 转 Modbus TCP 协议转换在 S7-1200 PLC化工反应釜中的应用
运维·人工智能·物联网·自动化·区块链
迎風吹頭髮2 小时前
UNIX下C语言编程与实践53-UNIX 共享内存控制:shmctl 函数与共享内存管理
服务器·c语言·unix
迎風吹頭髮2 小时前
Linux内核架构浅谈8-Linux内核与UNIX的传承:设计思想与特性差异
linux·运维·架构
猫头虎3 小时前
如何查看局域网内IP冲突问题?如何查看局域网IP环绕问题?arp -a命令如何使用?
网络·python·网络协议·tcp/ip·开源·pandas·pip
黑马金牌编程3 小时前
Linux 服务器常见的性能调优
linux·运维·服务器·性能优化
jieyu11193 小时前
网络、主机安全扫描工具
linux·安全·系统安全
沿着路走到底3 小时前
python 基础
开发语言·python
tianyuanwo3 小时前
Linux进程管理中的T状态问题分析与解决体系
linux·运维·进程管理·t状态