Linux Edit File ReadOnly Read only

Source: Internet
Author: User

Chattr-i/etc/hosts #hosts文件去掉禁止随意更改的功能, try a few more times. Then VI go in to modify the file.

Similarly, chattr +i/etc/hosts #为hosts文件添加防止修改的权限


-------------------------------------------------------------

Chattr (change attribute)

Feature Description: Change file properties.

Syntax: chattr [-rv][-v< version number >][+/-/=< properties >][file or directory ...]

Additional note: This directive alters the file or directory attributes stored on the ext2 file system, which have the following 8 modes:
A: Make the file or directory available for additional use only.
B: Do not update the last access time of the file or directory.
C: Compress the file or directory and store it.
D: Exclude files or directories from dumping operations.
I: Do not alter the file or directory arbitrarily.
S: Privacy delete files or directories.
S: Update files or directories instantly.
U: Remove outside of prevention.

Parameters
-R recursively handles all files and subdirectories under the specified directory.
-v< version number > set file or directory version.
-V Displays the instruction execution process.
+< Properties > Open the Item property of the file or directory.
-< Properties > Close the Item property of the file or directory.
The =< property > Specifies the Item property of the file or directory.


This article is from the "System Operations" blog, please be sure to keep this source http://gravel.blog.51cto.com/6432642/1657972

Linux Edit File ReadOnly Read only

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.