This article provides a guide for how to make a file or directory immutable.
Background
Setting the immutable flag on a file or folder will prevent any changes to it. For folders, this means that no files or folders may be added to or removed from the immutable folder. However, files and folders in the immutable folder can be modified.
How to Make a File or Directory Immutable
To make a file or a directory immutable, use the "chattr" command with the "+i" flag.
chattr +i /path/to/file
How to Make a File or Directory No Longer Immutable
To make a file or directory no longer immutable, use the following command:
chattr -i /path/to/file
Conclusion
You now know how to make a file or directory immutable.