O'Reilly logo

Linux Pocket Guide, 2nd Edition by Daniel J. Barrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

lsattr — stdin  stdout  - file  -- opt  --help  --version

Synopsis

lsattr [options] [files]

If you set extended attributes with chattr, you can view them with lsattr (list attributes). The output uses the same letters as chattr; for example, this file is immutable and undeletable:

$ lsattr myfile
-u--i--- myfile

With no files specified, lsattr prints the attributes of all files in the current directory.

Useful options

-R

Recursively process directories.

-a

List all files, including those whose names begin with a dot.

-d

If listing a directory, do not list its contents, just the directory itself.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required