cp:不能统计'孙子':没有这样的文件或目录

时间:2017-10-22 12:26:22

标签: ubuntu terminal cp

我正在尝试复制孙子目录并将其重命名为父母目录,并且反复给我这个错误:

brad@brad-Inspiron-5558: ~/cli-tmp/parents/children/grandchildren$ cp -r grandchildren ../nephews


cp: cannot stat 'grandchildren': No such file or directory

brad@brad-Inspiron-5558: ~/cli-tmp/parents/children/grandchildren$ cp -r grandchildren ../nephews

cp: cannot stat 'grandchildren': No such file or directory

我做错了什么?

1 个答案:

答案 0 :(得分:0)

假设您要将~/cli-tmp/parents/children/grandchildren复制到~/cli-tmp/parents/children/nephews,并且它们都存在,那么您可以cp使用完整路径或:

cd ~/cli-tmp/parents/children
cp -r grandchildren nephews

如果您想在示例中grandchildren内复制,则:

cp -r . ../nephews

.此处为当前目录,..为父级。

请注意,我认为grandchildren中存在children。你的失败是因为你基本上复制了~/cli-tmp/parents/children/grandchildren/grandchildren,这是不存在的。

相关问题