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 filenameTo reverse it:
chattr -i filenameIt’s perfect for protecting system files or critical configs from accidental changes. Check attributes with:
lsattr filenameNote: 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