LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Learning Bash: What's "cp: cannot stat" and why can't I copy a file (https://www.linuxquestions.org/questions/linux-newbie-8/learning-bash-whats-cp-cannot-stat-and-why-cant-i-copy-a-file-4175580392/)

gingerlinuxlover 05-22-2016 01:21 AM

Learning Bash: What's "cp: cannot stat" and why can't I copy a file
 
Greetings,

I use a Mac command line at work and at home I change clothes into my Linux Mint 17.3 world.

I AM fairly new to Linux and so I'm trying to learn command line best practices. I'm simply copying a file from the $HOME directory to my git repository.

1. What is this message?
2. Why am I getting it for a simple copy operation?
3. What can I do to accomplish my goal [copy .file from /home/user/Desktop to my locally- cloned git repo.

Thanks,

gingerlinuxlover



http://oi64.tinypic.com/4qkco7.jpg

jpollard 05-22-2016 10:01 AM

According to the image, the file doesn't exist.

grail 05-22-2016 11:44 AM

Show us the output of 'ls' in the same directory

sean.ferguson 05-22-2016 01:49 PM

You may not have appropriate permissions on the file to copy, the file name isnt typed correctly or the file isnt actually in the location you think it is.

ensure the file is in ~/Desktop with:

Code:

ls -al ~/Desktop
if it is in that folder, take note of the format of the filename. Filenames are case-sensitive. If it is infact in the folder and the filename is correct try ensuring you have correct permissions by doing:

Code:

chmod 775 ~/Desktop/Testing.txt
then try copying again. :)

If you are unsure about any of the commands used above, check the manpages first e.g. man chmod


All times are GMT -5. The time now is 09:37 AM.