commands.sh

chattr

linux

Change attributes of files or directories.

More info →

Examples (5)

Make a file or directory [i]mmutable to changes and deletion, even by superuser

sudo chattr +i path/to/file_or_directory

Make a file or directory mutable

sudo chattr -i path/to/file_or_directory

[R]ecursively make an entire directory and contents immutable

sudo chattr -R +i path/to/directory

Mark a directory and its files to be interpreted in a case-insensitive manner (case-[F]olding)

chattr +F path/to/directory

Set a file to only allow [a]ppending

sudo chattr +a path/to/file
made by @shridhargupta | data from tldr-pages