在linux中使用vim编辑文件时,很常见的一个问题,若没有正确定的退出编辑,系统会生成一个隐藏文件为.**.swp,此时若再次进入编辑,都会提示错误If you did this already, delete the swap file ".**.swp",若要想再次正确编辑文件和对后面工作不进行影响,必须先删除.**.swp文件。
需要使用
- [root@king playbook]# ls -a //查看所有文件包括隐藏文件
- [root@king playbook]# ls -a
- . .. test.sh .test.sh.swp
- [root@king playbook]# rm -rf .test.sh.swp
删除之后再次编辑文件就没问题了。