bash cp:无法统计`/vol/examples/tutorial/science.txt':没有那个文件或目录
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17842225/
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 stat `/vol/examples/tutorial/science.txt': No such file or directory
提问by bashboy
I tried a command cp /vol/examples/tutorial/science.txt .
and I get the error -
我尝试了一个命令cp /vol/examples/tutorial/science.txt .
,但出现错误 -
cp: cannot stat `/vol/examples/tutorial/science.txt': No such file or directory
cp:无法统计`/vol/examples/tutorial/science.txt':没有那个文件或目录
I don't understand why this is happening. I went to cygwin home folder and created the necessary folder structure and text file. I also checked the folder structure and names. So, why is it not working ?
我不明白为什么会这样。我去了 cygwin 主文件夹并创建了必要的文件夹结构和文本文件。我还检查了文件夹结构和名称。那么,为什么它不起作用?
回答by derlarsschneider
You said you
你说你
went to cygwin home folder and created the necessary folder structure and text file
转到 cygwin 主文件夹并创建必要的文件夹结构和文本文件
So the file you are trying to copy is not located in /vol/examples/tutorial/
but in ~/vol/examples/tutorial/
. ~
is an abbrevation for your cygwin home directory, usually /home/<username>
.
所以,你要复制的文件没有位于/vol/examples/tutorial/
但是在~/vol/examples/tutorial/
。~
是 cygwin 主目录的缩写,通常是/home/<username>
.
You should be able to copy the file as user000001 says: cp ~/vol/examples/tutorial/science.txt .
您应该能够像 user000001 所说的那样复制文件: cp ~/vol/examples/tutorial/science.txt .