Home  >  Article  >  Operation and Maintenance  >  How to restore read-only files in Linux

How to restore read-only files in Linux

WBOY
WBOYOriginal
2022-01-27 10:40:1510203browse

Linux file read-only recovery method: 1. Use the "chmod 666 specified file" command to set the read-only file to a read-only and writable file; 2. Use the "chmod 222 specified file" command to set the read-only file to a read-only file. The file is set to be writable but not readable.

How to restore read-only files in Linux

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

How to restore read-only files in Linux

First we open the operating system.

Find the terminal window in the menu bar and click to enter.

We create a new file as an example and set it as a read-only file.

If a read-only file is opened, read-only will be displayed.

How to restore read-only files in Linux

chmod 666 test.txt. At this time, execute the command. The test file is test.txt. 666 means to change it to a readable and writable file.

How to restore read-only files in Linux

No prompt will be displayed when opening the file at this time. Belongs to normal mode.

How to restore read-only files in Linux

chmod 222 test.txt is a file that is made writable but unreadable.

How to restore read-only files in Linux

#When you open the file at this time, you will be reminded that it cannot be opened because it is not readable.

How to restore read-only files in Linux

Related recommendations: "Linux Video Tutorial"

The above is the detailed content of How to restore read-only files in Linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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