linux swap file already exists,Swap file "..."already exists! 故障解决办法

Swap file "..."already exists! 故障解决办法

当我们用vim编辑编辑文件时,遇到死机,需要再次用xshell打开一个新的ssh连接(也就是两个ssh同时打开一个文件),

系统就会在源文件目录下自动创建一个.xxxx.swp结尾的缓存文件,当我们用vim再次打开源文件是会报故障提示:

实例:

[root@www ~]# vim /etc/named.rfc1912.zones

E325: ATTENTION

Found 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  skel

abrt                       DIR_COLORS               kdump.conf        .named.rfc1912.zones.swp      quotatab        smartd.conf

acpi                       DIR_COLORS.256color      krb5.conf         named.root.key                rc              sos.conf

adjtime                    DIR_COLORS.lightbgcolor  latrace.conf      nanorc                        rc0.d           ssh

aliases                    dracut.conf              latrace.d         NetworkManager                rc1.d           ssl

aliases.db                 dracut.conf.d            ld.so.cache       networks                      rc2.d           statetab

alsa                       environment              ld.so.conf        nsswitch.conf                 rc3.d           statetab.d

alternatives               ethers                   ld.so.conf.d      ntp                           rc4.d           subversion

anacrontab                 event.d                  libaudit.conf     ntp.conf                      rc5.d           sudo.conf

asound.conf                exports                  libibverbs.d      openldap                      rc6.d           sudoers

2.执行删除命令:

[root@www etc]# rm .named.rfc1912.zones.swp

rm: remove regular file `.named.rfc1912.zones.swp'? y

3.再次打开,没有问题

[root@www etc]# vim named.rfc1912.zones

©著作权归作者所有:来自51CTO博客作者luxing10的原创作品,如需转载,请注明出处,否则将追究法律责任

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值