如何解决.swp文件会影响实际文件吗?
我正在使用以下命令vi /etc/iptables/rules.v4
文件编辑文件,并且我的终端崩溃了。
当我再次尝试编辑同一文件时,收到以下消息
E325: ATTENTION
Found a swap file by the name "/etc/iptables/rules.v4.swp"
.
.
.
.
(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/iptables/rules.v4"
to recover the changes (see ":help recovery").
If you did this already,delete the swap file "/etc/iptables/rules.v4"
to avoid this message.
Swap file "/etc/iptables/rules.v4.swp" already exists!
[O]pen Read-Only,(E)dit anyway,(R)ecover,(D)elete it,(Q)uit,(A)bort:
我的问题是,这会影响我原来的rules.v4文件吗? 在停止处理文件之后 我对linux完全陌生
解决方法
swap文件是vim生成的临时文件,用于跟踪您在崩溃时所做的更改。如果文件rules.v4正常,则可以将其删除。否则,我强烈建议您将其恢复,保存并删除.swp文件。请注意,只要您不保存,“恢复”选项就不会写入规则中。v4
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。