重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 4092|回复: 0
打印 上一主题 下一主题

[Oracle] Swap file "/etc/.hosts.swp" already exists! 解决办法

[复制链接]
跳转到指定楼层
楼主
发表于 2020-11-25 13:16:11 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
故障:在使用vim编辑nginx的配置文件的时候,一直出现swp文件已存在的现象:
    在使用vim编辑某文件的时候,会产生一个swp文件
              .FILENAME.swp
  在正常编辑结束退出的时候,该文件会被自动删除


E325: ATTENTION
Found a swap file by the name "/etc/.hosts.swp"
          owned by: root   dated: Wed Nov 25 13:01:02 2020
         file name: /etc/hosts
          modified: YES
         user name: root   host name: strong
        process ID: 70264
While opening file "/etc/hosts"
             dated: Fri Jul 31 14:39:45 2020

(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/hosts"
    to recover the changes (see ":help recovery").
    If you did this already, delete the swap file "/etc/.hosts.swp"
    to avoid this message.

Swap file "/etc/.hosts.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:


解决办法:
[root@strong etc]# ll -a .hosts.swp
-rw-r--r--. 1 root root 12288 Nov 25 13:01 .hosts.swp
[root@strong etc]# rm .hosts.swp
rm: remove regular file ‘.hosts.swp’? yes
[root@strong etc]#

[root@strong etc]# vim hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6


192.168.0.145 strong
192.168.0.156 sztech
~
~
~
[root@strong etc]# cat hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6


192.168.0.145 strong
192.168.0.156 sztech


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-5-15 04:57 , Processed in 0.104501 second(s), 20 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表