cp:无法创建常规文件'/ home / Documents:权限被拒绝

问题描述 投票:0回答:1

我正在学习linux CLI,我在app.txt目录中创建了一个文件home。现在,我通过CLI将其复制到Documents,它显示了一个错误:

cp: cannot create regular file '/home/Documents': Permission denied

P.S(我检查了whoami,它显示的是我的根目录zain

谁能确认这是怎么回事?

linux permission-denied cp
1个回答
0
投票

我会假设您在app.txt目录中时尝试复制home

由于您的根目录为zain,将/home/Documents指定为目标路径将导致错误,因为CLI将返回zain目录(由于[C​​0]),然后查找/目录,该目录不存在。

相反,您只需要指定home作为目标路径,如下所示。同样,我假设您仍在Documents目录中。

home
© www.soinside.com 2019 - 2024. All rights reserved.