chattr Command

How to use the chattr command ?

                   This is an admin command. Only the Root user can change the file attributes/Process. chattr command is used to change the file attributes.


Syntax:


chattr [options] filename

 +i  -  Make the file as Read-Only.
  -i  -  Remove the Read-Only.
+a  -  Can't open file for writing
 -a  -  Open file for writing.
+S  -  The changes in the file are written synchronously on the disk.

Example:

chattr +i file.txt

chattr -i file.txt

No comments: