LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

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 (not its contents)
$ lsattr -d [path/to/dir]
copy
Show attributes with long names
$ lsattr -l [path/to/file]
copy
List attributes with version numbers
$ lsattr -v [path/to/file]
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
-p
List file's project number
-l
Use long names instead of single character abbreviations
-V
Display the program version

INSTALL

sudo apt install e2fsprogs
copy
sudo dnf install e2fsprogs
copy
sudo pacman -S e2fsprogs
copy
sudo apk add e2fsprogs-extra
copy
sudo zypper install e2fsprogs
copy
brew install e2fsprogs
copy
nix profile install nixpkgs#e2fsprogs
copy

CAVEATS

Only shows attributes on filesystems that support extended attributes (ext2/ext3/ext4, btrfs). The output format shows attribute flags as single characters (e.g., i for immutable, a for append-only) with a dash (-) for unset flags, followed by the filename.

HISTORY

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

SEE ALSO

chattr(1), ls(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid