Written by
Jenny ZengSummary: This article from iBoysoft explains what extended attributes on Mac are and how to remove extended attributes from Mac.
In computing, a file is more than its content. It's a combination of its content, name, structure, metadata, and extended attributes. These components work together to ensure the file can be stored, accessed, and managed efficiently by the operating system and applications.
Although extended attributes are not typically visible in Finder or standard file operations, you may still want to view or even remove them. For example, if you can't open an app downloaded from the internet, it's likely due to the quarantine extended attribute.
What are Mac extended attributes?
Mac extended attributes, often referred to as "xattrs," are a feature of the macOS file system that allows you to attach additional metadata or custom attributes to files and directories. These attributes are essentially small pieces of information that extend the standard file metadata (like file name, size, and permissions) without altering the file's actual content.
They are also widely used in Linux, BSD, and other file systems.
How to view extended attributes on Mac?
Extended attributes are stored separately in a file's metadata and can only be accessed using the xattr command in Terminal. They are named using a type signature, similar to preferences files, such as com.apple.FinderInfo. Some also have metadata subtypes, such as kMDItemIsScreenCapture.
To view them:
- Launch the Terminal app.
- Type the command below and hit enter.xattr file_path
Input xattr, leave a space, then drag and drop the file you want to check with to Terminal to get its file path, then press the Enter key. A sample command would be: xattr /Users/jenny/Desktop/Screenshot\ 2025-02-18\ at\ 5.15.29 PM.png
The sample input returns the following extended attributes:
In this example, you can find metadata utilized by Finder for displaying file tags and icons, metadata for tracking the last used date of the file, metadata for enforcing security policies, and metadata for identifying the file as a screen capture.
Here are some examples of extended attributes and their meanings:
com.apple.FinderInfo | Stores Finder-specific metadata such as label color, visibility, and icon placement. |
com.apple.quarantine | Indicates that a file was downloaded from the internet and may be quarantined for security reasons. |
com.apple.metadata:kMDItemWhereFroms | Stores the source URL or location from which a file was downloaded. |
com.apple.metadata:kMDItemDownloadedDate | Records the date and time when a file was downloaded. |
com.apple.TextEncoding | Specifies the text encoding used for a file, such as UTF-8 or ASCII. |
com.apple.ResourceFork | Stores legacy resource fork data, primarily used in older macOS versions. |
com.apple.lastuseddate#PS | Records the last accessed date and time for a file. |
com.apple.metadata:_kMDItemUserTags | Stores user-assigned tags or labels for a file. |
com.apple.metadata:kMDItemFSLabel | Specifies the Finder label color assigned to a file. |
com.apple.metadata:kMDItemAlternateNames | Stores alternate names or aliases for a file. |
com.apple.metadata:kMDItemComment | Stores user comments or notes associated with a file. |
com.apple.metadata:kMDItemOMUserTags | Stores OpenMeta user tags, used by some third-party applications. |
com.apple.metadata:kMDItemFSContentChangeDate | Records the date and time when a file's content was last modified. |
com.apple.metadata:kMDItemFSCreationDate | Records the date and time when a file was created. |
com.apple.metadata:kMDItemFSName | Stores the name of the file as it appears in the filesystem. |
Share this article if you find it helpful!
How to delete extended attributes on Mac?
When encountering issues on Mac, for example, errors that prevent you from opening apps on Mac, like "app is damaged and cannot be opened," app cannot be opened because it is from unidentified developer," "apple cannot check it for malicious software," removing the quarantine attributes is the most effective solution.
You may also face other situations where you need to delete the extended attributes of a file on Mac. Here's how:
- Open the Terminal app.
- Find the extended attribute of the file you want to remove.xattr file_path
- Remove the extended attribute.xattr -d attribute_name file_path
For instance, if you can't open the app Cornerstone, removing its quarantine bit (e.g., xattr -d com.apple.quarantine /Applications/Cornerstone.app) will stop the built-in security check from examining the app and allow you to open it.
Help others remove extended attributes on Mac by sharing this post!