chattr - change file attributes
Format: chattr [-RV] [-v] [mode] filename
-R – here it changes the attribute of the directory recursively
Eg1: chattr +a file1
Here it sets the appendable attribute to file file1 so that we can only do copy and append operations.
Eg2: chattr +i file1
Here it sets the immutable attribute to the file file1 so that we can only do copy operation.
Eg3: chattr –a file1
Here it removes the appendable attribute of the file1
The command lsattr is used to list the file attributes
Format: lsattr filename
Eg1: lsattr file1
It list the attributes of the file file1