craftwa.re

A walk outside the sandbox

Home Blog Cheat Sheets MacOS Tips Area 51 About

Display File Flags And Attributes

|

Overview

macOS introduced a non-standard ls option, not present in the official man page, to display file flags and attributes when using long output:

  -O      Include the file flags in a long (-l) output.

For example, in the following listing the ls system utility has the compressed and restricted flags:

$ ls -alO /bin/ls
-rwxr-xr-x  1 root  wheel  restricted,compressed 38624 15 Jul  2017 /bin/ls

The restricted flag is covered in this tip and the compressed attribute will have its own tip :)