-1

我正在使用以下命令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 完全陌生

4

1 回答 1

0

交换文件是由 vim 生成的临时文件,用于跟踪您在崩溃时所做的更改。如果文件 rules.v4 没问题,你可以删除它。否则,我强烈建议恢复、保存并删除 .swp 文件。注意只要不保存,Recover选项就不会写在rules.v4

于 2020-08-21T14:47:21.843 回答