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

时间:2023-01-11 00:19:06

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

Linux(centos7)下多个用户同时编辑一个文件,或编辑时非正常关闭,再下次编辑打开文件时均为显示如下警告信息:

E325: ATTENTION
Found a swap file by the name ".other.conf.swp"
owned by: root dated: Wed Nov 29 02:23:20 2017
file name: /usr/local/nginx/conf/other.conf
modified: YES
user name: root host name: host.localdomain
process ID: 19783 (still running)
While opening file "other.conf"
dated: Wed Nov 29 02:28:57 2017
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 other.conf"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file ".other.conf.swp"
to avoid this message.

Swap file ".other.conf.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:

-----------------------------

使用命令查看隐藏swp文件(隐藏文件都以.开头):
ls -a
查看当前目录下与打开的文件同名的.swp文件,如.other.conf显示为.other.conf.swp
使用rm -rf删除这个.swp文件,当再打开test.xml文件时,便不会弹出警告信息。
# rm -rf .other.conf.swp

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

  1. 删除编辑文件警告Swap file “…” already exists!

    Linux下多个用户同时编辑一个文件,或编辑时非正常关闭,再下次编辑打开文件时均为显示如下警告信息: Swap file "test.xml.swp" already exists ...

  2. vim 编辑提示swap file already exists 解决方法

    linux服务器上编辑 .ini 文件时卡死,关闭连接工具后重新进入操作该 .ini 文件时,会提示: E325: ATTENTION Found a swap file by the name &q ...

  3. VIM:Found a swap file by the name

    在linux下用vi或vim打开Test.java文件时 [root@localhost tmp]# vi Test.java出现了如下信息: E325: ATTENTION    Found a s ...

  4. 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 s ...

  5. 'swap file "xx" exists' linux

    solution: 1)swap to another tty, kill processes using 'sudo kill -9 pid' 2)'Recover' the 'warn-openn ...

  6. linux(2)文件和目录管理(新增,删除,复制,移动,文件和目录权限,文件查找)

    一.目录与路径 1.相对路径与绝对路径绝对路径:/开头, cd /usr相对路径:cd ../..2.目录操作(cd:change directory).:当前目录..:上一层目录-:上一个目录~:当 ...

  7. 【Linux】E297: Write error in swap file 解决办法

    今天登陆到服务器上,发现通过vi 打开文件就会报错: E297: Write error in swap file E303: Unable to open swap file for "c ...

  8. swp文件已存在

    vim编辑某个文件时,提示.xxx.sh.swp文件已存在是因为异常退出后,linux会生成一个swp文件,无论选择什么,下次进入还是会提示ll 命令无法看到文件使用 rm -rf .xxx.sh.s ...

  9. .swp文件的恢复

    .swp 编辑文件的过程中会出现这个隐藏文件. 文件如果正常保存,.swp就会自动删除.如果不正常退出,比如关机,.swp就会留下来. linux下: ls -all 可以查看隐藏文件 命令: vi ...

随机推荐

  1. __attribute__((packed))作用

    1. __attribute__ ((packed)) 的作用就是告诉编译器取消结构在编译过程中的优化对齐,按照实际占用字节数进行对齐,是GCC特有的语法.这个功能是跟操作系统没关系,跟编译器有关,g ...

  2. 《图形学》实验三:DDA算法画直线

    开发环境: VC++6.0,OpenGL 实验内容: 使用DDA算法画直线. 实验结果: 代码: #include <gl/glut.h> #include <math.h> ...

  3. WinForm timer控件

    timer 控件:按用户定义的时间间隔引发的事件 属性: Enabled   是否启用:  Interval    事件发生的事件间隔,单位是毫秒 事件只有一个:Tick    事件经过指定的时间间隔 ...

  4. 最全的Android源码目录结构详解&lpar;转&rpar;

     Android 2.1|-- Makefile|-- bionic                        (bionic C库)|-- bootable                (启动 ...

  5. PHP表单常用正则表达式(URL、HTTP、手机、邮箱等)

    <?php /** * @description: 正则表达式匹配 */ class Regex { /** * @手机号 */ public static function Phone($su ...

  6. linux 机器出现or type control d to continue问题的处理办法

    当出现这个界面时,主要是因为磁盘问题 直接输入root密码进入修复模式 在命令行下执行fsck命令 进行相关挂载目录或是磁盘的修改 看下 /etc/fatab下是否有 自己加的开机自动挂载的目录 ,看 ...

  7. 推荐几个好的 Maven 常用仓库网址

    注意,以下内容转载自:推荐几个好的 Maven 常用仓库网址 Maven 确确实实是个好东西,用来管理项目显得很方便,但是如果是通过 Maven 来远程下载 JAR 包的话,我宿舍的带宽是4兆的,4个 ...

  8. css loading

    css /*loading*/ .loader { width: 100px; height: 101px; border: 8px solid; border-top-color: hsl(154, ...

  9. c&sol;c&plus;&plus; 继承与多态 继承时如何改变个别成员的访问属性

    问题1:若类B以private的方式继承类A,但还想让类A的某些个别成员,保持public或者protected的访问属性,这时应该怎么办? 使用using,去改变访问属性. #include &lt ...

  10. 11g SPA &lpar;sql Performance Analyze&rpar; 进行升级测试

    注;转自http://ju.outofmemory.cn/entry/77139 11G的新特性SPA(SQL Performance Analyze)现在被广泛的应用到升级和迁移的场景.当然还有一些 ...