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