The Linux chattr command

Source: Internet
Author: User


chattr command


Description: Change the properties of a file


chattr [-RVF] [-v version] [mode] files ...


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


Change files attributes on a Linux second extended file system, changing the properties of the documents stored on the ext2 filesystem


There are 8 types of patterns.

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.


The symbolic pattern is: +-= (plus minus), plus the corresponding attributes

+-=[asacddiijsttu]


Append only (a),

Compressed (c),

No dump (d),

Immutable (i), immutable

Data journalling (j),

Secure deletion (s),

No tail-merging (t),

undeletable (U),

No atime updates (A),

Synchronous directory Updates (D),

Synchronous Updates (S),

and top of directory hierarchy (T).


Parameter description

-R: Recursive processing

-V: Show detailed procedures

+< 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.

Instance:

Add the +i attribute, prevent the file to be modified, carry on this operation to some confidential file, will have the very good effect, if can add this attribute to the/etc/passwd file, other people can only view

[email protected] test]# ll total 20-rw-r--r--1 root 08-24 01:17 1.txt-rw-r--r--1 root root 0 08-24 01:28 2.txt-rw -r--r--1 root root 08-24 01:20 3.txt[[email protected] test]# chattr +i 1.txt [[email protected] test]# vim 1.txt

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/71/F0/wKiom1Xa9R7BraKLAABSC5pLnkA743.jpg "title=" QQ picture 20150824184153.jpg "alt=" Wkiom1xa9r7braklaabsc5plnka743.jpg "/>



This article is from the "Small City Studio" blog, please be sure to keep this source http://xcroom.blog.51cto.com/7941996/1687778

The Linux chattr command

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.