Header Ads


How to View & Remove Extended Attributes from a File on Mac OS

How to View & Remove Extended Attributes from a File on Mac OS


Extended Attributes are metadata components that can be unique to specific files and file types on Mac OS. Those extended attributes can be anything from identifying data about the file itself, to quarantine information, origin data, label information, amongst other types of metadata. Sometimes, advanced Mac users may review extended attributes for a file, or even wish to remove extended attributes from a file or directory for a variety of reasons, and either of those tasks can be accomplished through the command line with the bundled xattr tool in Mac OS. This tutorial will walk through how to both view and remove extended attributes from a file on a Mac. This is an advanced topic that is really only relevant to advanced users who are already familiar with extended attributes and have a particular reason to want to remove them from a file. If youre not sure what extended attributes are, why they may (or may not) matter, or why you might want to (or not want to) remove them, this is not for you. The xattr command has been around in Mac OS and Mac OS X for a long time and thus this should work the same on virtually all vaguely modern versions of system software: For example, you might see something like the following after executing the command: In this case youll see metadata information that can be used by Spotlight and the Finder search features, as well as quarantine data which may be tied to data downloaded from the web, or brought onto the Mac through a third party app or source. And yes, that is the same quarantine data from that tells you whether or not you see the when opening certain applications or files thats a commonly encountered practical example of an extended attribute. Still in the Terminal app? If not, relaunch Terminal application to begin: In this example, removing com.apple.metadata:kMDItemIsScreenCapture from the samplefile.jpg file strips out the screenshot identifier, which you may recognize from , which relies on that extended attribute attached to screenshot files in order to locate them. By removing that extended attribute, the file would no longer show up in such a search. Note that does also remove extended attribute metadata from the images, it only removes the EXIF data the two are separate. You can use the xattr tool to view and remove extended attributes on files, directories, and symbolic links this way, and you can use wildcards to apply the extended attribute removal to multiple files as needed. This is really not something that should be of relevance to most casual Mac users, but for advanced Mac users, tinkerers, developers, sysadmins, information security workers, and many others, being able to view or modify extended attributes can be helpful for particular reasons.


No comments

Powered by Blogger.