Home > Operation and Maintenance > Linux Operation and Maintenance > What file has the suffix of linux swp?

What file has the suffix of linux swp?

青灯夜游
Release: 2023-04-17 09:39:26
Original
4131 people have browsed it

In Linux, the file with the swp suffix is ​​a swap partition file, which is generated when using vi or vim to edit a file. When the editing is completed and exits normally, the file will be automatically deleted; the swp file is hidden Files can be viewed by using "ls -al" in the directory.

What file has the suffix of linux swp?

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

The file with swp suffix is ​​the swap partition file.

1. The phenomenon of swp files appears

We use the vi command to edit a file, and a prompt appears as shown in the figure. At this time, we can also directly Press the E key to edit normally, but it may still happen next time.

What file has the suffix of linux swp?

2. Reason

#1: When we edit a file, another person Also when editing, it will appear;

2: When we are editing a file, there is a sudden power outage or a sudden disconnection from the Internet. In order to prevent data loss, this kind of file will also appear.

3. Solution

When this file is generated, we can directly delete this swp file with rm -f .abc.swp, otherwise A prompt will appear every time the file is edited, but if an abnormal exit occurs after editing the file, our configuration is not saved in the abc file. We need to use vi -r abc to restore, as shown in the figure to restore the file. , and then press Enter, the configuration will be restored from .swp to abc, and then delete the .swp file

Steps:

First, we need to use vi -r Kmer_evaluation.py to restore , will open the file, press Enter, save and use wq! Do not use wq, it will be restored from .swp to Kmer_evaluation.py

vim -r Kmer_evaluation.py
Copy after login

Then delete the .swp file

rm -rf .Kmer_evaluation.py.swp
Copy after login

Related Recommended: "Linux Video Tutorial"

The above is the detailed content of What file has the suffix of linux swp?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template