How to make a file immutable on Linux

Written By
X
Xmodulo
Jan 26, 2015

chattr is a Linux command which allows one to set or unset attributes on a file, which are separate from the standard (read, write, execute) file permission.

A related command is lsattr which shows which attributes are set on a file. While file attributes managed by ‘chattr’ and ‘lsattr’ are originally supported by EXT file systems (EXT2/3/4) only, this feature is now available on many other native??Linux??file systems such as XFS, Btrfs, ReiserFS, etc.

X

Xmodulo

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.