首页 > 系统相关 >linux 解决vim无法正常打开文件

linux 解决vim无法正常打开文件

时间:2022-08-25 00:04:19浏览次数:73  
标签:文件 exports name vim etc file linux swp

如果在使用vim打开某个文件时出现以下内容,是因为上次打开文件后未正常关闭,留下了一个文件名加.swp后缀的文件(隐藏文件),删除这个.swp文件便能正常打开文件了

E325: ATTENTION

Found a swap file by the name "/etc/.exports.swp"
owned by: root dated: Wed Aug 24 23:39:12 2022
file name: /etc/exports
modified: YES
user name: root host name: nfs
process ID: 5732 (still running)
While opening file "/etc/exports"
dated: Wed Aug 24 23:40:34 2022
NEWER than swap file!

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

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

记住上面提示的隐藏文件的名称 --> 倒数第二行:/etc/.exports.swp

在文件所在文件夹中进行操作
使用命令rm -rf .exports.swp既可正常打开文件进行编辑

标签:文件,exports,name,vim,etc,file,linux,swp
From: https://www.cnblogs.com/milkkkkkkk/p/16622737.html

相关文章

  • npm+react linux 开荒
    安装npmyuminstallnodejs.x86_64yuminstallnpm.x86_64 更新GCC版本(参考链接:https://blog.csdn.net/qq_39715000/article/details/120703444)升级到gcc7.3yum-y......
  • linux-文件权限
    一、/etc/passwd文件Linux系统使用一个专门的文件来将用户的登录名匹配到对应的UID值。这个文件就是/etc/passwd文件,它包含了一些与用户有关的信息。字段分别是:登录......
  • Linux 圈内导航
    欢迎来到Linux多彩世界 CentOS    |    Ubuntu    |    Kail   ......
  • Linux下的常用函数
    1.open函数open函数:用来打开或者创建一个文件或者设备。1.函数原型:intopen(constchar*pathname,intflags);intopen(constchar*pathname,intflags,mode_t......
  • Linux常用简单命令
    0.前言小白刚接触Linux。所以总结了Linux中常用的简单命令。本文涉及Linux常用的简单命令的介绍。比如说如何在指定路径下创建文件或者文件夹,如何安装软件/卸载软件等。1......
  • VIM编辑器的基本使用
    1.在Linux终端下打开《VIM教程》[xiaocer@localhost~]$vimtutor2.命令模式下常用操作1.删除删除光标所在一行内容:dd删除光标所在行开始n行内容:ndd2.复制复制一......
  • MyBatis核心配置文件
    mybatis-config.xml<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEconfigurationPUBLIC"-//mybatis.org//DTDConfig3.0//EN""http://mybatis.......
  • hadoop-day1-切分文件
    java模拟切分文件packagecom.shujia;importjava.io.*;importjava.util.ArrayList;publicclassSplitFileBlock{publicstaticvoidmain(String[]args)......
  • 如何查看.o和.exe文件
    生成目标文件test.cpp如下所示:#include<iostream>usingnamespacestd;intga;intgb=100;intmain(){staticintsa;staticintsb=200;in......
  • 进一步解决关于maven打包时,资源文件没有被打包进来的问题
    进一步解决关于maven打包时,资源文件没有被打包进来的问题起因第一次使用Mybatis,将配置文件放在java包下,结果出现了配置文件编译后无法同步到target目录下这里我们可以......