lsattr — List Linux File Attributes

lsattr shows extended file attributes on Linux filesystems. These attributes are separate from normal permissions and can explain why a file behaves differently than expected.

List attributes for a file

lsattr filename

List attributes in a directory

lsattr

Check attributes recursively

lsattr -R /path/to/directory

One important attribute is i, which means immutable. A file with the immutable attribute cannot be modified or deleted until that attribute is removed.

To change attributes, use chattr. To only inspect them, use lsattr.

Leave a Comment