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 09-18-2004, 09:42 PM   #1
mark001
LQ Newbie
 
Registered: Sep 2004
Posts: 27

Rep: Reputation: 15
Unhappy cp directory command


I tried to copy /home/user/abcd/ to /home/user/efgh/ using the cp comand, but received the message cp: omitting directory '/home/user/agcd/'. I tried several times with and without the back slash but still got the same message.

could anyone point out what is wrong with the command?

my distro is redhat 8

Thanks.
 
Old 09-18-2004, 09:50 PM   #2
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
try with -r option i.e.

cp -r /home/user/abcd/ /home/user/efgh/

cp copies files, -r tells copy to go recursivley to get all the files.
 
Old 09-18-2004, 11:07 PM   #3
mark001
LQ Newbie
 
Registered: Sep 2004
Posts: 27

Original Poster
Rep: Reputation: 15
Smile

I type:-

cp -r /home/user/abcd/ /home/user/efgh/


IT WORKED.

Thanks leonscape.

excellent forum for newbies.
 
Old 09-18-2004, 11:12 PM   #4
Kristijan
Member
 
Registered: Sep 2003
Location: Melbourne, Australia
Distribution: NetBSD 3.0.1, Slackware 10.1
Posts: 394

Rep: Reputation: 30
Just to point out mark001, it's always good to take a read over the manual pages.

So, using the above example;

Code:
man cp
Scroll down, and read through each switch and see if it does what you're looking for. So in the cp man page, you would have come across;

Code:
-R, -r, --recursive
              copy directories recursively
It just might be helpfull in the future for other commands.

Welcome to LQ.org

-Kristijan
 
Old 09-19-2004, 12:50 AM   #5
akudewan
Member
 
Registered: Apr 2004
Location: India
Distribution: Ubuntu
Posts: 364

Rep: Reputation: 31
Okie, after six months of using linux, I never figured out how to copy directories from the terminal. I guess when I am told to RTFM, I really must RTFM. Or I can just browse linuxforum
 
Old 09-19-2004, 01:00 AM   #6
mirradric
Member
 
Registered: May 2004
Location: Singapore
Distribution: Debian woody and debian sarge
Posts: 188

Rep: Reputation: 31
The man pages contains lots of information about the commands and some even provide examples. You can learn a lot by going through them. Most questions are easily answer if you just look at the man page.

BTW some of the file managers/web browsers like Konquerer can handle man pages. just type
Code:
man:/cp
in the address bar of konquerer to view the man page of cp. man:/ gives you an index.
There's xman as well. Good for leisure browsing of the man pages...

Gosh, I must be way too bored...
 
  


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
Change directory command gizmobay Linux - Newbie 4 11-23-2005 06:11 PM
Is there a command that alerts when a directory/file changes? davee Linux - General 1 09-19-2005 08:46 AM
Directory Summary Command canuck_barlow Linux - Newbie 8 03-01-2005 01:16 PM
Command to remove a directory... xconspirisist Linux - Software 2 11-28-2003 01:06 PM
what is the command to remove the directory Harish_f Linux - General 6 06-19-2002 03:32 AM

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

All times are GMT -5. The time now is 10:25 PM.

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