LinuxCommandLibrary

lsattr

lists file attributes on Linux ext2/ext3/ext4 filesystems

TLDR

List attributes

$ lsattr
copy
List for path
$ lsattr path/to/file
copy
Recursive listing
$ lsattr -R
copy
Show hidden files
$ lsattr -a
copy
List directory attributes
$ lsattr -d
copy

SYNOPSIS

lsattr [OPTIONS] [files...]

DESCRIPTION

lsattr lists file attributes on Linux ext2/ext3/ext4 filesystems. It shows special attributes like immutable, append-only, and other extended attributes set by chattr.

PARAMETERS

-R

List attributes recursively
-a
List all files including hidden ones
-d
List directories themselves, not their contents
-v
List file's version/generation number
-l
Use long names instead of single character

CAVEATS

Only shows attributes on filesystems that support extended attributes. The output format shows attribute letters followed by the filename.

HISTORY

lsattr is part of e2fsprogs, providing attribute listing for Linux filesystems.

SEE ALSO

chattr(1), ls(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community