eri*_*icg 8 unix command-line ownership macos
我在这里找到了类似的问题,但为这些问题提供的答案并不能解决我的问题。
如果我做:
sudo chown <username> main.m
Run Code Online (Sandbox Code Playgroud)
我收到操作不允许的错误。
先前错误的一般解决方案是:
sudo chflags nouchg main.m
Run Code Online (Sandbox Code Playgroud)
清除锁定标志。但是,执行此操作后,我仍然无法 chown 文件。我也试过:
chflags noschg main.m
Run Code Online (Sandbox Code Playgroud)
在没有任何运气的单用户模式下 - 我收到一个操作不允许的错误。
如果有人有任何想法,我会感兴趣。
我知道可以通过四种 三种不同的方式保护 Mac 文件:
ls -l
和修复chown(1)
和chmod(1)
。uchg
和schg
你有看到ls -lO
与修复chflags(1)
。GetFileInfo filename
。您还可以使用ls -l@
. 你可以用SetFile(1)
. uchg
标志。ls -le
并使用 ACL 相关参数修复chmod(1)
。因此,让我们通过将所有这些标志组合到以下来查看您的文件的情况ls
:
ls -lO@e main.m
Run Code Online (Sandbox Code Playgroud)
听起来您已经知道如何处理 #1 和 #2。
如果您看到一个 ACL (#4),您可以使用与 ACL 相关的参数来修复它chmod(1)
。
如果您仍然感到困惑,请使用ls
我上面建议的组合命令的输出更新您的答案,以便我们可以看到发生了什么。
归档时间: |
|
查看次数: |
12195 次 |
最近记录: |