The chattr +i command makes a file immutable, meaning it canāt be edited, deleted, or renamedāeven by root. Use it like this:
chattr +i filename
To reverse it:
chattr -i filename
Itās perfect for protecting system files or critical configs from accidental changes. Check attributes with:
lsattr filename
Note: Only works on ext-based filesystems and requires root access. Use wisely to keep your Linux environment safe and stable.
Best Regards,
N I Rimon
Top comments (0)