Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 09-18-2004, 10:42 PM   #1
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

Old 09-18-2004, 10:50 PM   #2
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-19-2004, 12:07 AM   #3
LQ Newbie
Registered: Sep 2004
Posts: 27

Original Poster
Rep: Reputation: 15

I type:-

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


Thanks leonscape.

excellent forum for newbies.
Old 09-19-2004, 12:12 AM   #4
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;

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;

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

Welcome to

Old 09-19-2004, 01:50 AM   #5
Registered: Apr 2004
Location: India
Distribution: Ubuntu
Posts: 364

Rep: Reputation: 30
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, 02:00 AM   #6
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
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...


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

All times are GMT -5. The time now is 06:02 AM.

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