Immutable: unchanging over time or unable to be changed.

For a myriad of reasons, you might want a file or a number of files to be unalterable. There’s different approaches you could take to achieve this. You could forexample make them hidden, change their permissions to make them read-only or you could as I will be demonstrating make them immutable. An immutable file can not be deleted or altered in anyway. Let’s get right to work.

Open up your linux terminal: CTRL + ALT + T

Type the following command

$ chattr +i [path to file]

There you go, your file is now immutable. To see that it works, try deleting it(try this on a file you don’t need just in case…)

If for whatever reason you want to reverse this, type the following command

$ chattr -i [path to file]