当前位置:网站首页>vim 出现 Another program may be editing the same file. If this is the case 的解决方法
vim 出现 Another program may be editing the same file. If this is the case 的解决方法
2022-07-04 12:32:00 【码农研究僧】
问题所示
通过vim或者vi编辑文件的时候出现如下所示:
终端显示如下:
Found a swap file by the name "/mydata/mysql/conf/.my.conf.swp"
owned by: root dated: Sat Jul 02 12:52:53 2022
file name: /mydata/mysql/conf/my.conf
modified: YES
user name: root host name: xx
process ID: xx
While opening file "/mydata/mysql/conf/my.conf"
CANNOT BE FOUND
(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 /mydata/mysql/conf/my.conf"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file "/mydata/mysql/conf/.my.conf.swp"
to avoid this message.
Swap file "/mydata/mysql/conf/.my.conf.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:
截图如下:
2. 原理分析
在linux中系统为了保证安全性,如果文件遭到不一
比如多人编辑这个文件导致文件的不一、上次编辑没有正常退出等
会将其文件后缀生成一个swp格式的文件(临时交换文件,主要备份缓冲区内容)
保存或者写入文件的方式无误,一般swp格式文件都会自动删除,如果写入有误,临时文件就会一直存在,再次编辑的时候就会一直指到改文件
将其删除重新编辑或者恢复重新编辑即可
3. 解决方法
通过ls -al查看全部文件的时候
可以看到swp格式(隐藏临时文件,临时缓冲区)
vim编辑出现的提示:
根据如下提示对应解决
如果文件不重要,直接q退出,rm -rf删除重新再来即可
边栏推荐
- 2021-08-09
- Number and math classes
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 11
- Interview question MySQL transaction (TCL) isolation (four characteristics)
- SAP ui5 date type sap ui. model. type. Analysis of the display format of date
- OSI model notes
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 21
- [Android reverse] function interception instance (③ refresh CPU cache | ④ process interception function | ⑤ return specific results)
- Login operation (for user name and password)
- TCP fast retransmission sack mechanism
猜你喜欢
Process communication and thread explanation
Automatic translation between Chinese and English
Memory computing integration: AI chip architecture in the post Moorish Era
Introduction of network security research direction of Shanghai Jiaotong University
Properties and methods of OS Library
Reptile learning winter vacation series (2)
SAP ui5 date type sap ui. model. type. Analysis of the display format of date
22 API design practices
2018 meisai modeling summary +latex standard meisai template sharing
Foreach (system.out:: println) usage
随机推荐
Video analysis
Alibaba cloud server connection intranet operation
Clion configuration of opencv
01. Basics - MySQL overview
DDS-YYDS
ASP. Net razor – introduction to VB loops and arrays
Reptile learning 4 winter vacation learning series (1)
Workplace liquor bureau must pay attention to
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 12
The detailed installation process of Ninja security penetration system (Ninjitsu OS V3). Both old and new VM versions can be installed through personal testing, with download sources
Install freeradius3 in the latest version of openwrt
Function parameters (positional parameters, default value parameters, variable parameters, named keyword parameters, keyword parameters)
QQ group administrators
Snowflake won the 2021 annual database
The frost peel off the purple dragon scale, and the xiariba people will talk about database SQL optimization and the principle of indexing (primary / secondary / clustered / non clustered)
netstat
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 9
Exceptions and exception handling
Map container
Openssl3.0 learning 20 provider KDF