Show extended attributes in listings with ls -@

The macOS-specific -@ flag makes ls print each file's extended attribute names and their byte sizes right under the long listing — a quick audit you can run over a whole folder at once.

macOSlsxattrlistingLow risk
Run `ls -@ ~/Downloads` to see which files carry xattrs, and `ls -l@` to combine it with the full long-form listing.

01Command

Command
$ ls -@ ~/Downloads
ls -l@ file.pdf

02What it does

Under -@, each entry with extended attributes gets an extra indented line per attribute showing its key and size, such as com.apple.metadata:kMDItemWhereFroms with its byte length. It turns a task that would otherwise need a per-file xattr -l loop into a single glance, which is handy before batch-modifying attributes.

03Risk

RiskLow risk
!Warning: The listing shows attribute names and sizes only; to see or change values you still need xattr.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-09-17 · Category: Files & Folders

06Related solutions