cp: cannot stat: No such file or directory exists
99,646
That is because the file name has spaces in it. You should either use escape character \
or use single quotes. That is either:
cp Indexing\ and\ Slicing.ipynb /home/uswang
or
cp 'Indexing and Slicing.ipynb' /home/uswang
Related videos on Youtube
Author by
NoVice
Updated on September 18, 2022Comments
-
NoVice over 1 year
Orienting myself with basic terminal commands (Ubuntu 16.04); I have a file listed in my Downloads folder; a Jupyter notebook file called, 'Indexing and Slicing.ipynb' and wish to copy the file to my user directory, 'uswang'. After navigating to the Downloads folder, I tried the command;
cp Indexing and Slicing.ipynb /home/uswang (To be 100% certain I even copy/paste the full file name) but receive the error, cp: cannot stat 'Indexing': No such file or directory cp: cannot stat 'and':No such file or directory cp: cannot stat 'Slicing': No such file or directory
I get the same error when trying the mv command.
Why would this be the case? Tried researching other cp cannot stat entries, but none seem to relate directly to my predicament - Thanks
-
Peter Krauss over 3 yearsSee also the quotes and
*
syntax magic
-
-
NoVice over 5 yearsThank you. I did wonder, because the error came back 3 times if it might have something to do with the spaces, but thought I would check in with the community