Fedora Linux Support Community & Resources Center
  #1  
Old 27th May 2012, 07:28 PM
Socrates440 Offline
Registered User
 
Join Date: May 2012
Location: Aspen
Posts: 48
linuxfirefox
cp command

I am reading a textbook on how to use linux and I am having some trouble with the cp command. I have succesfully used it to copy files in one folder/directory to the same folder/directory.

@localhost Documents]$ cp copythisfile copythisfile2


However, I am having trouble copying it into a new folder. I created a new folder in my doccuments folder called d2. It's location is: /home/username/documents/d2. I tried to copy my file into that folder by typing:

localhost Documents]$ cp copythisfile /home/rootless/documents/d2

This command returns the error message
cp: cannot create regular file `/home/username/documents/d2': No such file or directory


Any ideas?

Thanks!
Reply With Quote
  #2  
Old 27th May 2012, 07:59 PM
RupertPupkin Offline
Registered User
 
Join Date: Nov 2006
Location: Detroit
Posts: 5,658
linuxfedorafirefox
Re: cp command

The Linux filesystem is case-sensitive. Notice the different cases here, highlighted in red:
Code:
localhost Documents]$ cp copythisfile /home/rootless/documents/d2
I suspect that the d2 directory you created is in /home/rootless/Documents, not /home/rootless/documents. You can find out for sure with this command:
Code:
ls -ld /home/rootless/documents/d2
I suspect you'll get an error, because that directory doesn't exist.

So to make this work, try this command instead:
Code:
cp copythisfile /home/rootless/Documents/d2
__________________
"I'm not glad he's dead, but I'm glad he's gone."
-- Richard M. Stallman, on the death of Steve Jobs
Reply With Quote
  #3  
Old 27th May 2012, 08:12 PM
Socrates440 Offline
Registered User
 
Join Date: May 2012
Location: Aspen
Posts: 48
linuxfirefox
Re: cp command

I did have it capitalized correcty in my terminal. For further clarification, the folder location is definitely
/home/rootless/Documents/d2

---------- Post added at 07:12 PM ---------- Previous post was at 07:10 PM ----------

Heh, I just tried it again and it worked. I don't know what I did differently but I am not complaining. Thanks!
Reply With Quote
  #4  
Old 27th May 2012, 08:18 PM
marko Offline
Registered User
 
Join Date: Jun 2004
Location: Laurel, MD USA
Posts: 6,050
linuxfirefox
Re: cp command

A really good way to reduce spelling annoyances is to make the shell work for you. Just type a few letters of the directory or filename in the command and hit the Tab key. The shell will show all the matches if the result is ambiguous or put the name in for you if it's not.
Quote:
cp copythisfile /home/rootless/Doc<tabkey>
Reply With Quote
  #5  
Old 27th May 2012, 09:22 PM
stevea Offline
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,836
linuxfirefox
Re: cp command

Quote:
Originally Posted by marko View Post
A really good way to reduce spelling annoyances is to make the shell work for you. Just type a few letters of the directory or filename in the command and hit the Tab key. The shell will show all the matches if the result is ambiguous or put the name in for you if it's not.
Yes, prevents a load of typos. Also you probably want to install this ...
sudo yum -y install bash-completion
as it completes very app specific items with the <tab> completion method. Things like command options or you can "ping h<tab>" and get a list or completions of known host beginning with 'h'.
__________________
None are more hopelessly enslaved than those who falsely believe they are free.
Johann Wolfgang von Goethe
Reply With Quote
Reply

Tags
command

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Java jre1.6.0_97 Export Command Line Command richm8027 Using Fedora 23 7th September 2008 08:04 AM


Current GMT-time: 18:01 (Saturday, 20-09-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat