HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

xattr — Utility to work with extended filesystem attributes. More information: <https://keith.github.io/xcod

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandextendedxattrcliwithfilesystemworkutility
macos

Problem

How to use the xattr command: Utility to work with extended filesystem attributes. More information: <https://keith.github.io/xcode-man-pages/xattr.1.html>.

Solution

xattr — Utility to work with extended filesystem attributes. More information: <https://keith.github.io/xcode-man-pages/xattr.1.html>.

List key:value extended attributes for a given file:
xattr -l {{file}}


Write an attribute for a given file:
xattr -w {{attribute_key}} {{attribute_value}} {{file}}


Delete an attribute from a given file:
xattr -d {{com.apple.quarantine}} {{file}}


Delete all extended attributes from a given file:
xattr -c {{file}}


Recursively delete an attribute in a given directory:
xattr -rd {{attribute_key}} {{directory}}

Code Snippets

List key:value extended attributes for a given file

xattr -l {{file}}

Write an attribute for a given file

xattr -w {{attribute_key}} {{attribute_value}} {{file}}

Delete an attribute from a given file

xattr -d {{com.apple.quarantine}} {{file}}

Delete all extended attributes from a given file

xattr -c {{file}}

Recursively delete an attribute in a given directory

xattr -rd {{attribute_key}} {{directory}}

Context

tldr-pages: osx/xattr

Revisions (0)

No revisions yet.