繁体   English   中英

.swp 文件会影响真实文件吗?

[英]Does .swp file affect the real file?

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM