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. 并发编程---互斥锁---互斥锁与join的区别

    互斥锁 互斥锁:就是把多个进程并发,修改成一块共享数据的操作变成串行,保证是一个一个来修改的. 缺点:效率低,加锁过程复杂 优点:增加了安全性 from multiprocessing import ...

  2. C# install-package:"xx"已拥有为“xxx”定义的依赖项

    可能 nuget自身的版本落后于适配程序包的版本 Visual Studio 2013 更新 NuGet 包管理器 Ø  前言 使用 Visual Studio 中的 NuGet 包管理器下载程序时, ...

  3. 由于找不到 MSVCR100.dll,无法继续执行代码

    由于找不到 MSVCR100.dll,无法继续执行代码.重新安装程序可能会解决此问题 360软件管家中找到  进行安装即可

  4. 【LDA】周志华

    一.书籍

  5. Redis入门到高可用(七)——Hash

    一.结构 Mapmap结构: filed 不能相同,value可以相同. 二.重要指令 ♦️ HSET  ♦️ HGET  ♦️ HDEL ♦️ Hlen  ♦️ HEXISTS ♦️HGETALL  ...

  6. CMDB资产管理

    .传统运维和自动化运维的区别: 传统运维: 1.项目上线: a.产品经理前期调研(需求分析) b.和开发进行评审 c.开发进行开发 d.测试进行测试 e.交给运维人员进行上线 上线: 直接将代码交给运 ...

  7. k8s pv 的三种挂载模式

    ReadWriteOnce:可读可写,只能被一个Node节点挂载 ReadWriteMany:可读可写,可以被多个Node节点挂载 ReadOnlyMany:只读,能被多个Node节点挂载

  8. mybatis 调用 oracle 存储过程 select into 无记录时NO_DATA_FOUND异常处理分析

    首先根据这篇文章:http://www.cnblogs.com/coolzdp/p/7717332.html 我们知道存储过程中 SELECT * INTO 如果没有记录是不会往下执行的,直接抛出NO ...

  9. js中两个!!的理解

    在js中经常有两个!!出现,经常让人难以理解 (function () { var a = 10; var b = 20; function add(num1, num2) { var num1 = ...

  10. vue父子组件写法,数据传递,顺便封装 element-ui的弹窗组建

    父组件如下: <template> <div class="print"> <el-button @click="bbclick" ...