本文共 2661 字,大约阅读时间需要 8 分钟。
当我们用vim编辑编辑文件时,遇到死机,需要再次用xshell打开一个新的ssh连接(也就是两个ssh同时打开一个文件),系统就会在源文件目录下自动创建一个.xxxx.swp结尾的缓存文件,当我们用vim再次打开源文件是会报故障提示:实例:[root@www ~]# vim /etc/named.rfc1912.zonesE325: ATTENTIONFound a swap file by the name "/etc/.named.rfc1912.zones.swp" owned by: root dated: Thu Feb 25 13:26:28 2016 file name: /etc/named.rfc1912.zones modified: no user name: root host name: www.luxing.com process ID: 3704 (still running)While opening file "/etc/named.rfc1912.zones" dated: Thu Feb 25 13:26:16 2016(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 /etc/named.rfc1912.zones" to recover the changes (see ":help recovery"). If you did this already, delete the swap file "/etc/.named.rfc1912.zones.swp" to avoid this message.Swap file "/etc/.named.rfc1912.zones.swp" already exists!1.先查看目录[root@www etc]# ls -a. depmod.d issue.net named.rfc1912.zones .pwd.lock shells.. dhcp kdump-adv-conf named.rfc1912.zones.bak quotagrpadmins skelabrt DIR_COLORS kdump.conf .named.rfc1912.zones.swp quotatab smartd.confacpi DIR_COLORS.256color krb5.conf named.root.key rc sos.confadjtime DIR_COLORS.lightbgcolor latrace.conf nanorc rc0.d sshaliases dracut.conf latrace.d NetworkManager rc1.d sslaliases.db dracut.conf.d ld.so.cache networks rc2.d statetabalsa environment ld.so.conf nsswitch.conf rc3.d statetab.dalternatives ethers ld.so.conf.d ntp rc4.d subversionanacrontab event.d libaudit.conf ntp.conf rc5.d sudo.confasound.conf exports libibverbs.d openldap rc6.d sudoers2.执行删除命令:[root@www etc]# rm .named.rfc1912.zones.swp rm: remove regular file `.named.rfc1912.zones.swp'? y3.再次打开,没有问题[root@www etc]# vim named.rfc1912.zones
转载于:https://blog.51cto.com/858004880/1744975