In a computer equipment it is possible to accumulate a Lots of information which can be like a true tower of Babel and as a consequence, the saturation of the system can become important. But much more important are some of our data, which can be really fundamental for our day to day and losing it or having someone access it would not be a dish of good taste at all.
For these cases we have the chattr command, which will allow us to protect the files that matter most to us.
The chattr command is typically used to modify the attributes of the ext2 and ext3 filesystems. You could say that this command is analogous to the chmod command, but with different syntax and options. If used properly, we can make it difficult for an intruder who has gained sufficient privileges on our system to interact with our files.
The command is very easy to use, and with it we can change the properties of our files or folders in a simple way. For example, if we want that a file cannot be deleted, nor renamed, that symbolic links cannot be pointed out, nor can data be written to the file, we will use the following syntax:
# chattr + i filename or path
To work with folders it is identical, the only difference is that if we want to change attributes in the files on a recurring basis (the files that the folder contains) we will use the –r attribute.
# chattr -r + i folder name or path
But we have many more options available, which we can know as always in the manual: man chatter