How to Change File Attributes in Linux with Chattr Command

In this tutorial, we’ll be showing you what attributes are there, and how to change them with the chattr command. The command chattr stands for change attribute.

File attributes are certain properties that are associated with the file. The attributes allow a file to have some characteristics that are valid for all users.

For example, if a file were to be assigned the read-only attribute, that file would not allow any user (including root) to modify it. Obviously, the root user could modify the file, but only after removing the read-only attribute.