macos - 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
为什么它仍然给出错误消息?
解决方案
为了写入/usr/sbin
,您需要禁用不推荐的系统完整性保护。如果这是您想要的,您可以使用命令禁用它csrutil disable; reboot
,但首选使用它/usr/local/bin
,您不必禁用 SIP 即可在其上写入。
推荐阅读
- python - 检查匹配组是否存在而没有“尝试”?
- flutter - 共享首选项和全局配置之间的 Flutter 差异
- php - Symfony,如何编写正确的测试来检查某人是否被删除?
- javascript - 带有firebase云功能的axios帖子
- excel - Excel 列与其他数据的行
- c - 将字符数组复制到函数外部的字符串
- python - 如何在不使用稳定排序的情况下使用 Python 对可迭代进行排序?
- c - 重新定位的 ffmpeg 示例文件失败
- sharepoint-online - 如何在使用 Power Automate 添加列表项后更新它
- github - 在 github 操作中指定运行器版本