错误出现情况的是,在我们用VI编辑文件时候在文件加载时候出现错误提示,需要在安任意键后才能正常编辑.
错误提示类似如下:E325: ATTENTION
Found a swap file by the name "/etc/sysconfig/.iptables.swp"
owned by: root dated: Sun Mar 12 09:53:43 2017
file name: /etc/sysconfig/iptables
modified: YES
user name: root host name: 64.242.55.116.broad.km.yn.dynamic.163da
process ID: 3443
While opening file "/etc/sysconfig/iptables"
dated: Sun Mar 12 09:55:13 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 /etc/sysconfig/iptables"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file "/etc/sysconfig/.iptables.swp"
to avoid this message.
"/etc/sysconfig/iptables" 22L, 879C
这种情况一般是由于在用vi编辑时候突然出现异常导致vi编辑终止导致的。例如 用SSL连接编辑时,断开。
处理方法:
通常出现这样的情况是因为之前操作中意外中断后系统在同级目录下生成了一个.开头的同名文件。
如上报错是在编辑防火墙配置文件时候出现的,在同级目录下生成了.iptables.swp的文件。只需要上了就额可以正常了。
删除命令:rm –f .iptables.swp
红色是生成的文件名字