chattr [+-=][Options] File or directory name
+ Add Permissions
-Delete Permissions
= equals a permission
Options:
I file settings I property, do not allow the deletion of files, renaming, add, modify data, the equivalent of the entire file locked up
Directory Settings I property, can only modify the files in the directory data, cannot create, delete files
A file set a property, can only add data in the file, cannot delete and modify (only use echo xxx >> file)
Directory setting a property, only the contents of the file can be created and modified in the directory, but the file cannot be deleted
Attention:
1. The restriction on this command is as effective as root
2. It is not intended to be a limitation, but to prevent mis-operation
Lsattr option file name
A show all files and directories
D If the target is a directory, listing only the properties of the directory itself, not the file
Rights Management in Linux file attribute permissions