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}}
License and Disclaimer
The content on this page is copyright © 2014—present the tldr-pages team and contributors.This page is used with permission under Creative Commons Attribution 4.0 International License.
While we do attempt to make sure content is accurate, there isn't a warranty of any kind.