
macOS can attach a quarantine attribute to files downloaded from the internet or received from another source. This metadata helps macOS apply security checks before you open an app, installer, script, or other executable file.
If you trust the file and need to remove its quarantine attribute, you can do so in Terminal with xattr. The safest approach is to inspect the file first, remove only the quarantine attribute, and keep a record of the original value so you can restore it if necessary.
Quick Answer
- Open Terminal.
- Check whether the file has a quarantine attribute:
bash
xattr -p com.apple.quarantine "/path/to/file"
- If the attribute exists and you trust the file, remove it:
bash
xattr -d com.apple.quarantine "/path/to/file"
- Verify that it is gone:
bash
xattr -p com.apple.quarantine "/path/to/file"
The final command should report that the attribute does not exist. Removing quarantine metadata does not make an unsafe file safe; it only prevents that particular metadata-based check from being applied.
What the quarantine attribute does
The quarantine attribute is extended file metadata stored outside a file’s ordinary contents. macOS may use it to identify files obtained from the internet, email, messaging apps, browsers, or other untrusted locations.
When you open a quarantined app or installer, macOS may display a warning or perform additional checks. Removing the attribute can change that behavior. It does not:
- Repair a damaged file
- Remove malware
- Bypass every macOS security control
- Grant permission to access the file
- Make an unsigned or untrusted app safe
- Change the file’s contents
Only remove the attribute when you understand where the file came from, have checked it with appropriate security tools, and are sure you need to change its behavior.
Warning: Do not remove quarantine metadata simply because an unfamiliar file displays a warning. The warning may be the only indication that macOS is treating the file as potentially unsafe.
Before you begin
Confirm that you have the correct file
A Terminal command can affect the wrong file if its path is incorrect. Identify the exact file in Finder first. If possible, copy the file to a temporary location or make a backup before changing its metadata.
For files with spaces or punctuation in their names, enclosing the path in quotation marks prevents the shell from misreading it. You can also drag a file from Finder into a Terminal window to insert its path.
Close the app that uses the file
If the file is open, close the related app before changing its metadata. Save your work first. Removing an attribute usually does not change the file’s contents, but closing the app avoids confusion if it has already inspected or cached the file’s security state.
Check access before changing metadata
You may need permission to modify extended attributes. If the file is in a protected location, move a copy to a folder you control rather than immediately using elevated privileges.
For a broader review of ownership and permissions, see how to check file and folder permissions in Terminal on a Mac.
Method 1: Remove only the quarantine attribute
This is the preferred method when you know the file’s location and want to change only its quarantine metadata.
1. Open Terminal
Open Terminal from Applications > Utilities, or use Spotlight to find it.
2. Inspect the file’s extended attributes
The following command lists the extended attributes attached to the specified file:
xattr "/path/to/file"
Replace /path/to/file with the actual path. This command only reads metadata; it does not change the file.
Look for:
com.apple.quarantine
If the attribute is not listed, there is no quarantine attribute to remove from that path.

3. Read and save the quarantine value
The next command prints the value stored in the quarantine attribute:
xattr -p com.apple.quarantine "/path/to/file"
The -p option prints the attribute’s value. Save the result somewhere secure if you want a precise reversal path. Do not modify the value before restoring it.
4. Remove the quarantine attribute
The following command deletes only com.apple.quarantine from the selected file:
xattr -d com.apple.quarantine "/path/to/file"
The -d option means delete the named attribute. It does not delete the file or remove other extended attributes.
5. Verify the result
Run the inspection command again:
xattr -p com.apple.quarantine "/path/to/file"
If the attribute was removed, xattr should report that the attribute does not exist. You can also list all remaining attributes:
xattr "/path/to/file"
If the file still has other attributes, that is not necessarily a problem. The goal of this procedure is to remove the quarantine attribute only.

How to restore the quarantine attribute
Removing metadata is not always reversible unless you saved its original value. If you recorded the output from the xattr -p command, restore it with xattr -w.
The following example uses a placeholder value. Replace ORIGINAL_VALUE with the exact value you saved, without changing its characters:
xattr -w com.apple.quarantine "ORIGINAL_VALUE" "/path/to/file"
The -w option writes the supplied value to the named attribute. Verify it afterward:
xattr -p com.apple.quarantine "/path/to/file"
If you did not save the original value, you can add a quarantine attribute again, but you cannot reliably reconstruct the original metadata from memory. Do not invent a value and assume it represents the file’s original state.
Method 2: Remove quarantine metadata from a folder or its contents
Sometimes a downloaded package contains multiple files, such as an app bundle or a folder of scripts. You can inspect the folder recursively before deciding whether a broader change is appropriate.
Warning: A recursive command can affect many files. Review the path carefully, and do not run it on your home folder, system folders, or a broad directory unless you intend to change every matching file.
Inspect quarantine attributes recursively
This command searches the specified directory and prints files that have a quarantine attribute:
find "/path/to/folder" -type f -exec xattr -p com.apple.quarantine "{}" ; 2>/dev/null
The find command walks through files below the selected folder. xattr -p reads each file’s quarantine value, while 2>/dev/null hides error messages for files that do not have that attribute.
Because the output does not include every path in a convenient format, use this inspection as a preliminary check rather than treating it as a complete report.
Remove the attribute recursively
If you have reviewed the folder and intentionally want to remove quarantine metadata from every file beneath it, run:
find "/path/to/folder" -type f -exec xattr -d com.apple.quarantine "{}" ; 2>/dev/null
This deletes only com.apple.quarantine from each file for which the attribute exists. It does not delete files or remove other attributes.
A safer alternative is to process one known app or file at a time. Recursive removal is most appropriate when you understand the folder’s contents and all of them came from a source you trust.

When not to use sudo
Avoid adding sudo automatically. It runs a command with elevated privileges and can change files that your normal account cannot safely modify. It can also make a mistake more consequential.
If the file belongs to another user or is stored in a protected location, first consider:
- Making a copy in a folder you control
- Confirming the file’s ownership and permissions
- Changing access only when you understand why it is restricted
Quarantine removal is not the same as fixing ownership or permissions. If access is the actual problem, use a permissions-focused procedure instead of forcing the metadata command with sudo. You can also review how to fix file ownership and permissions safely using Terminal on a Mac.
Troubleshooting
“No such xattr: com.apple.quarantine”
This means the specified file does not currently have that attribute. Check that:
- You used the correct file path
- You are checking the file itself rather than a shortcut or alias
- The file was not replaced by another copy
- You did not already remove the attribute
List all attributes to confirm:
xattr "/path/to/file"
If the list is empty, the file has no extended attributes.
“Operation not permitted”
The file may be in a protected location, owned by another account, or subject to privacy controls. Confirm the path and check the file’s permissions before changing anything. Moving a copy to a user-owned folder is generally safer than immediately using sudo.
If Terminal cannot access a location because of macOS privacy protections, review System Settings > Privacy & Security and grant access only when you understand why it is needed.
The warning still appears
Removing quarantine metadata may not remove every warning. macOS can apply other checks based on the file type, its signature, its contents, or the app attempting to open it.
Verify that the attribute is actually gone:
xattr -p com.apple.quarantine "/path/to/file"
Then confirm that you changed the correct file. For an app, the relevant metadata may be attached to the app bundle or to files inside it. Avoid recursively removing attributes unless you have reviewed the consequences.
The file will not open after removing quarantine
The problem may be unrelated to quarantine. The file could be incomplete, incompatible, damaged, unsigned, or missing required components. Restore the original file from a trusted backup or download it again from the publisher’s official source.
Do not repeatedly remove security metadata as a substitute for verifying the file.
The attribute returns later
A file can receive quarantine metadata again when it is downloaded, copied from another source, extracted, or replaced by a new version. Check the file after the operation and make sure you are opening the same copy whose metadata you changed.
Frequently Asked Questions
Is it safe to remove the quarantine attribute?
It is safe only when you trust the file and understand the security warning you are changing. Removing the attribute reduces one layer of macOS’s handling for that file; it does not verify the file or remove malware.
Does removing quarantine delete the file?
No. xattr -d com.apple.quarantine deletes only the named metadata attribute. It does not delete the file’s contents or other extended attributes.
Can I remove quarantine from an app?
Yes, if you understand the app’s source and need to change how macOS handles it. An app bundle may contain multiple files, so inspect it carefully before using a recursive command.
Can I undo the change?
Only precisely if you saved the original quarantine value. Use xattr -w with that saved value to restore it. Without the original value, you can add an attribute again, but you cannot guarantee that it matches the previous metadata.
Should I remove all extended attributes instead?
No. Avoid broad commands such as deleting every extended attribute unless you have a specific reason and understand the consequences. Other attributes may be used by macOS or applications. Remove only com.apple.quarantine when that is the intended change.
Does this fix permission errors?
No. Quarantine metadata and file permissions are separate. If the error concerns ownership, access, or read/write permissions, investigate those settings instead of removing quarantine.
Final Thoughts
The safest way to remove a quarantine attribute is to inspect the exact file, save its original value, delete only com.apple.quarantine, and verify the result. Use recursive commands sparingly, avoid unnecessary sudo, and remember that removing metadata does not make an untrusted file safe.