macos 如何使目录可写?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1070216/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 06:14:57  来源:igfitidea点击:

How can I make directory writable?

macosterminal

提问by samoz

How can I make a directory writable, from the OS X terminal?

如何从 OS X 终端使目录可写?

采纳答案by northpole

chmod 777 <directory>

chmod 777 <directory>

This will give you execute/read/write privileges. You can play with the numbers to finely tune your desired permissions.

这将为您提供执行/读/写权限。您可以使用数字来微调您想要的权限。

Here is the wikiwith great examples.

这是带有很好示例的wiki

回答by Alan Haggai Alavi

  • chmod +w <directory>or chmod a+w <directory>- Write permission for user, group and others

  • chmod u+w <directory>- Write permission for user

  • chmod g+w <directory>- Write permission for group

  • chmod o+w <directory>- Write permission for others

  • chmod +w <directory>chmod a+w <directory>- 用户、组和其他人的写入权限

  • chmod u+w <directory>- 用户的写权限

  • chmod g+w <directory>- 组的写入权限

  • chmod o+w <directory>- 为他人写权限

回答by samoz

chmod +w <directory>

回答by Osei-Bonsu Christian

To make the parent directory as well as all other sub-directories writable, just add -R

要使父目录以及所有其他子目录可写,只需添加 -R

chmod -R a+w <directory>

回答by ze zhang

chmod 777 <directory>

this not change all ,just one file

这不会改变所有,只是一个文件

chmod -R a+w <directory>

this ok

这还好

回答by Tadele Ayelegn

Execute at Admin privilege using sudoin order to avoid permission denied (Unable to change file mode) error.

使用管理员权限执行sudo以避免权限被拒绝(无法更改文件模式)错误。

sudo chmod 777 <directory location>