How to Change File Attributes in Linux with Chattr Command

How to Change File Attributes in Linux with Chattr Command

Written By
E
EdXD
Dec 1, 2021

In this tutorial, we’ll be showing you what attributes are there, and how to change them with the chattr command. The command chattr stands for change attribute.

File attributes are certain properties that are associated with the file. The attributes allow a file to have some characteristics that are valid for all users.

For example, if a file were to be assigned the read-only attribute, that file would not allow any user (including root) to modify it. Obviously, the root user could modify the file, but only after removing the read-only attribute.

E

EdXD

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.