1. Role
Modify the attributes of the ext2 and ext3 file systems and use the permission superuser.
2. Format
Chattr-RV-+ = aacddijssu-vversion file or directory
3. Main Parameters
-R: recursively processes all files and subdirectories.
-V: displays the modified content in detail and prints the output.
-: Invalid attribute.
+: Activation attribute.
=: Specifies the attribute.
A: atime: Tell the system not to modify the last access time of this file.
S: sync, once appliedProgramThe system immediately writes the Modification result to the disk by performing a write operation on the file.
A: appendonly: the system only allows data to be appended to this file, and does not allow any process to overwrite or intercept this file. If the directory has this attribute, the system will only allow the creation and modification of files under this directory, and will not allow the deletion of any files.
I: immutable. The system does not allow any modifications to this file. If the directory has this attribute, any process can only modify the files under the Directory and cannot create or delete files.
D: an error occurs in the compressed file.
D: nodump. During file system backup, the dump program ignores this file.
C: compress. The system compresses the file transparently. When reading from this file, the returned data is extracted. When writing data to this file, the data is first compressed before being written to the disk.
: Securedelete: enables the system to fill the region of the file with 0 When deleting the file.
U: undelete: When an application requests to delete this file, the system will keep its data block so that the file can be deleted in the future.