当前位置:网站首页>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删除重新再来即可
边栏推荐
- Function parameters (positional parameters, default value parameters, variable parameters, named keyword parameters, keyword parameters)
- Realize cross tenant Vnet connection through azure virtual Wan
- 2018 meisai modeling summary +latex standard meisai template sharing
- Entitas learning [iv] other common knowledge points
- Star leap plan | new projects are continuously being recruited! MSR Asia MSR Redmond joint research program invites you to apply!
- 22 API design practices
- OSI seven layer model & unit
- [Android reverse] function interception instance (③ refresh CPU cache | ④ process interception function | ⑤ return specific results)
- . Does net 4 have a built-in JSON serializer / deserializer- Does . NET 4 have a built-in JSON serializer/deserializer?
- Single spa, Qiankun, Friday access practice
猜你喜欢

Summary of Shanghai Jiaotong University postgraduate entrance examination module firewall technology

Decrypt the advantages of low code and unlock efficient application development

2018 meisai modeling summary +latex standard meisai template sharing

2021-08-09
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 9](/img/ed/0edff23fbd3880bc6c9dabd31755ac.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 9

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)

Lecture 9

The database connection code determines whether the account password is correct, but the correct account password always jumps to the failure page with wrong account password

DVC use case (VI): Data Registry

(August 10, 2021) web crawler learning - Chinese University ranking directed crawler
随机推荐
World document to picture
About the use of URL, href, SRC attributes
How do std:: function and function pointer assign values to each other
Four sorts: bubble, select, insert, count
queue
First knowledge of spark - 7000 words +15 diagrams, and learn the basic knowledge of spark
Recommend a cool geospatial data visualization tool with low code
How to create a new virtual machine
A few words explain redis cache penetration, breakdown, avalanche, and redis sentinel
Googgle guava ImmutableCollections
Interview question MySQL transaction (TCL) isolation (four characteristics)
Lvs+kept highly available cluster
ASP. Net razor – introduction to VB loops and arrays
Data communication and network: ch13 Ethernet
Introduction of network security research direction of Shanghai Jiaotong University
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 24
BCD code Baidu Encyclopedia
01. Basics - MySQL overview
Unity performance optimization reading notes - explore performance issues -profiler (2.1)
Force buckle 142 Circular linked list II