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. C语言课堂题集

    1.输入一个整数,然后将其数字位置颠倒. int c,d=0,e; scanf("%d",&c); while (c!=0) { e=c%10; d=d*10+e; c/= ...

  2. 操作防火墙-centos7

    centos7对防火墙的操作systemctl status firewalld # 查看防火墙状态systemctl stop firewalld.service # 停止防火墙systemctl ...

  3. Entity Framework学习 - 5.DB First执行时提示model没有key

    原因:自动生成的类中有关联主键,没有自动生成Key及Column 解决方法:在xxx.tt的66行左右修改为 var simpleProperties = typeMapper.GetSimplePr ...

  4. Sql批量修改帝国cms文章发布时间(需unix时间,否则会变为1970-01-01)

    在迁移网站时,有时我们需要将帝国cms文章发表时间批量修改为当前时间,在帝国cms后台→系统设置→备份与恢复数据→执行sql语句: update phome_ecms_news set newstim ...

  5. 20170720 Celery 异步任务处理到Sql Server 发生死锁

    -- 1.  异常提示情况如下: 需要解决为什么引起死锁 -- 叹气 原因: 在使用Celery 启用了 配置参数 CELERYD_CONCURRENCY = 10  表示开了10块线程池. 有好处, ...

  6. Python3学习之路~5.3 random模块

    random模块常用方法: import random # 随机数 print(random.random()) # 生成一个0到1的随机浮点数,0 <= n < 1.0 print(ra ...

  7. cxPivotGrid导出数据

    导出数据,需要在uses区域引用cxExportPivotGridLink 根据导出类型使用以下过程 procedure cxExportPivotGridToHTML procedure cxExp ...

  8. 微信公众号支付开发当前URL未注册解决办法

    微信公众号支付,则需要现在微信支付商户后台,预先添加支付网址才可以.否则会出现“当前URL未注册”字样的报错. 方法/步骤 1. 报错实例如下,手机端微信调起微信支付框时弹出 2. 首先需要登录微信支 ...

  9. PHP策略模式2

    <?php /** PHP 策略模式 * 策略模式是对象的行为模式,用意是对一组算法的封装.动态的选择需要的算法并使用. * 策略模式指的是程序中涉及决策控制的一种模式.策略模式功能非常强大,因 ...

  10. react 嵌套组件的通信

    在react中经常会用到的组件嵌套,如下: 图中 parent本身是一个自定义的组件,然后内部又加入了 child的自定义组件,那么这种情况,父子之间如何通信 react中在父组件里面有一个 this ...