Skip to content

Latest commit

 

History

History
73 lines (58 loc) · 894 Bytes

mac file attributes.md

File metadata and controls

73 lines (58 loc) · 894 Bytes

Extended attributes

Indicated by @ in ls

Show extended attributes

xattr -l <dir/file>

Show extended attributes recursively

xattr -rl <dir/file>

Clear all extended attributes

xattr -c <dir/file>

Clear all extended attributes recursively

xattr -rc <dir/file>

File flags (chflags)

Indicated by nothing in ls

Flags can be:

  • arch
  • archived
  • opaque
  • nodump
  • sappnd
  • sappend
  • schg
  • schange
  • simmutable
  • uappnd
  • uappend
  • uchg
  • uchange
  • uimmutable
  • hidden

List file flags

ls -lO <dir/file>

Remove flag

chflags no<flag> <file/dir>

Remove flag recursively

chflags -R no<flag> <dir>

Remove flag recursively and be verbose

chflags -Rvv no<flag> <dir>

Access Control List

Indicated by + in ls

List flags

ls -le