使用vi的时候如果出现以下错误
(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 httpd.conf"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file ".httpd.conf.swp"
to avoid this message.
解决方法:
(1)杀掉vi进程
[root@localhost conf]# ps -ef|grep vi
root 1751 1528 0 19:59 pts/1 00:00:00 vi /etc/httpd/conf/httpd.conf
root 1865 1770 0 21:00 pts/0 00:00:00 grep vi
[root@localhost conf]# kill -9 1751
(2)删除swp缓存文件
[root@localhost /]# find -name .httpd.conf.swp
./etc/httpd/conf/.httpd.conf.swp
[root@localhost /]# cd /etc/httpd/conf/
[root@localhost conf]# rm -rf .httpd.conf.swp
备注:该博文为原创博文,如果转发请注明出处。(max.li)