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
Share:
99,646

Related videos on Youtube

NoVice
Author by

NoVice

Updated on September 18, 2022

Comments

  • NoVice
    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

  • NoVice
    NoVice over 5 years
    Thank 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