首页 > 解决方案 > mv 终端不允许操作

问题描述

英文说明

我尝试使用以下代码使用终端移动文件夹中的文件:

sudo mv dnsmasq / usr / sbin /

结果,我收到以下错误:

mv: rename dnsmasq to / usr / sbin / dnsmasq: Operation not permitted

即使我遵循了这种方法:

脚步:

 Apple menu -> System Preferences -> Security & Privacy -> Privacy -> Full Disk Access -> +

选择:

Applications -> Utilities -> folder -> Terminal -> open / grant terminal full disk access privileges. -> Relaunch terminal

为什么它仍然给出错误消息?

标签: macosterminalrootdnsmasq

解决方案


为了写入/usr/sbin,您需要禁用不推荐的系统完整性保护。如果这是您想要的,您可以使用命令禁用它csrutil disable; reboot,但首选使用它/usr/local/bin,您不必禁用 SIP 即可在其上写入。


推荐阅读