Linux cp: 无法创建目录权限被拒绝
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10683379/
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
cp: cannot create directory Permission denied
提问by Pawan
I have a Folder named "Parser" with in my directory .
我的目录中有一个名为“Parser”的文件夹。
I am trying to copy this folder (Parser) from my own directory to my collegues directory under /home/vinay
我正在尝试将此文件夹 (Parser) 从我自己的目录复制到 /home/vinay 下的我的同事目录
But i am getting this Exception
但我收到了这个异常
cp: cannot create directory `/home/vinay/Parser': Permission denied
cp:无法创建目录`/home/vinay/Parser':权限被拒绝
These are the commands i executed .
这些是我执行的命令。
-bash-3.00$ cp -r Parser /home/vinay/
cp: cannot create directory `/home/vinay/Parser': Permission denied
采纳答案by Jinghao Shi
This is because you have no permission to write vinay's home folder.
这是因为您无权写入 vinay 的主文件夹。
You can do this either as a root user (if you're in sudoer list), or you can place the file at someplace public (e.g. /tmp) and told vinay to fetch it there.
您可以以 root 用户身份(如果您在 sudoer 列表中)执行此操作,也可以将文件放在公共的某个地方(例如 /tmp)并告诉 vinay 在那里获取它。
This is an article about linux file permissions. Hope it helps.
这是一篇关于linux文件权限的文章。希望能帮助到你。
回答by tuxuday
The error message reads Permission denied, which means you - a user - don't have permission to write to vinay - another person - home directory. For more reading
错误消息显示Permission denied,这意味着您 - 一个用户 - 无权写入 vinay - 另一个人 - 主目录。更多阅读