gpt4 book ai didi

deleting quarantine files: xattr error in mac terminal(删除隔离文件:mac终端中的xattr错误)

转载 作者:bug小助手 更新时间:2023-10-22 16:39:14 35 4
gpt4 key购买 nike



I'm trying the following command to delete quarantined files:

我正在尝试使用以下命令删除隔离的文件:


sudo xattr -r -d com.apple.quarantine mydirectory

I get the error:

我得到错误:


attr: [Errno 1] Operation not permitted:

I have full permission to the folder, and I've disabled SIP on mac. On the actual files within this directory, my permission is "custom access" and that doesn't seem to be able to be modified.

我拥有该文件夹的完全权限,并且我已经在mac上禁用了SIP。在这个目录中的实际文件上,我的权限是“自定义访问”,似乎无法修改。


Running ls -lO I don't see any permissions issue on the files in the directory.

运行ls-lO时,我看不到目录中的文件有任何权限问题。


What else can I try? I'm at a loss.

我还能尝试什么?我不知所措。


更多回答
优秀答案推荐

As described in this article from Rich Trouton, check if your files have that extended attribute:

如Rich Trouton的本文所述,请检查您的文件是否具有扩展属性:


cd /path/to/mydirectory
find . -xattrname com.apple.quarantine

You can try and limit your xattr -d to only those files.

您可以尝试将xattr-d限制为仅包含这些文件。


cd /path/to/mydirectory
find . -xattrname com.apple.quarantine -exec xattr -r -d com.apple.quarantine {} \;

But if it is still not working, check the ownership of your folder and its content. And their ACLs (ls -le).

Check also their immutable flag (ls -lO).

但是,如果它仍然不起作用,请检查文件夹及其内容的所有权。以及他们的ACL(ls-le)。还要检查它们的不可变标志(ls-lO)。



Here are some ideas to get you started =>

以下是一些让您开始的想法=>


Run the command with sudo to elevate permissions:

使用sudo运行命令以提升权限:


sudo xattr -r -d com.apple.quarantine mydirectory

Use the -R flag instead of -r to recursively delete attributes:

使用-R标志而不是-R递归删除属性:


sudo xattr -R -d com.apple.quarantine mydirectory 

Check if there are any hidden files/directories that may be blocking access. Use:

检查是否有任何可能阻止访问的隐藏文件/目录。使用:


ls -la

Try changing the permissions on the files recursively to allow write access:

尝试递归更改文件的权限以允许写入访问:


sudo chmod -R u+w mydirectory

As a last resort, you may need to disable System Integrity Protection (SIP) on macOS. Restart into Recovery Mode and run:

最后,您可能需要在macOS上禁用系统完整性保护(SIP)。重新启动到恢复模式并运行:


csrutil disable

Then try the xattr command again. Re-enable SIP when done.

然后重试xattr命令。完成后重新启用SIP。


更多回答

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com