chattr
Change attributes of files or directories. More information: https://manned.org/chattr.
- Make a file or directory immutable to changes and deletion, even by superuser:
chattr +i {{path/to/file_or_directory}}
- Make a file or directory mutable:
chattr -i {{path/to/file_or_directory}}
- Recursively make an entire directory and contents immutable:
chattr -R +i {{path/to/directory}}
This is a tldr pages (source, CC BY 4.0) web wrapper for cheat-sheets.org. All commands, popular commands, most used linux commands. Referrals. Progressive Web Application (PWA) version to install on your device.