LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-22-2016, 01:21 AM   #1
gingerlinuxlover
LQ Newbie
 
Registered: May 2016
Posts: 1

Rep: Reputation: Disabled
Cool 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
 
Old 05-22-2016, 10:01 AM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
According to the image, the file doesn't exist.
 
Old 05-22-2016, 11:44 AM   #3
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192
Show us the output of 'ls' in the same directory
 
Old 05-22-2016, 01:49 PM   #4
sean.ferguson
LQ Newbie
 
Registered: Feb 2012
Location: Scotland
Distribution: Ubuntu 16.04 / Debian 8 / Arch
Posts: 25

Rep: Reputation: Disabled
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
small bash script copy one file to list of directories on file lahirushanaka Linux - Newbie 10 06-14-2014 11:00 AM
bash script to copy a file from the internet AgentD Programming 3 01-23-2009 11:29 PM
Bash : Copy a file every one minute macabre_sunsets Programming 15 09-16-2006 12:26 AM
smbclient copy problem (cant stat file...) taiwf Linux - Networking 6 08-01-2005 05:27 PM
/usr/bin/stat not present. Can I just copy the file mystique98ls Linux - Newbie 2 01-06-2005 02:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration