Linux chattr command


  Translation results:

Change file attributes

Linux chattr commandsyntax

Function: chattr command is used to change file attributes.

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

Linux chattr commandexample

Use the chattr command to prevent a key file in the system from being modified:

chattr +i /etc/resolv.conf
lsattr /etc/resolv.conf

will display the following attributes

----i-------- /etc/resolv.conf

Allow a file to only append data to it, but not delete it, applicable to various log files:

chattr +a /var/log/messages

Home

Videos

Q&A