lsattr

lsattr - list file attributes on a Linux second extended file system.


Display file attributes:

lsattr file.txt

Display file attributes recursively:

lsattr -R /home/james/backup/

Display file attributes of all files in a directory:

lsattr -a

Display attributes of a directory:

lsattr -d /home/james/pictures/

Display the file's version/generation number:

lsattr -v file.txt

List of possible attributes:

a append only
A no atime updates
c compressed
C no copy on write
d no dump
D synchronous directory updates
e extent format
i immutable
j data journalling
s secure deletion
S synchronous updates
t no tail-merging
T top of directory hierarchy
u undeletable

Read-only attributes, not modified by chattr:

E compression error
h huge file
I indexed directory
N inline data
X compression raw access
Z compressed dirty file