View & Remove Mac Extended Attributes from a File

January 21, 2019 | 01:40 PM

Bunnbuns


Extended Attributes are metadata components specific to files and file types on Mac OS. Those extended attributes can be identifying information about the file itself, such as quarantine information, origin data, label information, amongst other types of metadata.

Being able to view or modify extended attributes can be helpful.

To view the extended attributes of a file, open terminal and type the following:

xattr ~/Desktop/samplefile.jpg

You may see something like the following after executing the command:

xattr ~/Desktop/samplefile.jpg
com.apple.metadata:kMDItemIsScreenCapture
com.apple.metadata:kMDItemScreenCaptureGlobalRect
com.apple.metadata:kMDItemScreenCaptureType
com.apple.metadata:kMDItemWhereFroms
com.apple.quarantine

How to Remove Extended Attributes from a File on Mac

To remove a specific attribute from a file, type the following with the attribute you would like to remove:

xattr -d com.apple.metadata:kMDItemIsScreenCapture ~/Desktop/samplefile.jpg


http://osxdaily.com/2018/05/03/view-remove-extended-attributes-file-mac/

1 Comment

Guest

to remove all attributes, use xattr -cr

February 3, 2020 | 02:30 PM