Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've issued the following command:

sudo cp ~/Transfers/ZendFramework-1.11.4-minimal/library/Zend/* ~/public_html/cmsk.dev/library/

When I do this, I start getting the following messages:

cp: omitting directory `Tag' 
cp: omitting directory `Test' 
cp: omitting directory `Text' 
cp: omitting directory `TimeSync' 
cp: omitting directory `Tool' 
cp: omitting directory `Translate' 
cp: omitting directory `Uri' 
cp: omitting directory `Validate' 

and so on...

Why do I get these messages ?

share|improve this question

3 Answers 3

up vote 118 down vote accepted

By default, cp copies only the direct files in, and not subdirectories in the directory. The message cp: omitting directory 'directory' warns you that the mentioned directory is not copied.

To do so, specify the -r (or --recursive) option:

sudo cp -r ~/Transfers/ZendFramework-1.11.4-minimal/library/Zend/* ~/public_html/cmsk.dev/library/

A hint for the future, read the manual page (command: man cp) as it contains an overview of the available options.

share|improve this answer
    
Thanks a lot. I thought that * will deal with it recursively somehow. But no. :D Thanks again. :) –  MEM Apr 18 '11 at 15:20
7  
@MEM: the * is expanded by Bash, not by cp. Test it yourself by putting echo in front of your command. When expanded, it matches everything with a preceding ...library/Zend/ (the files and directories in it). –  Lekensteyn Apr 18 '11 at 15:26

Couple of things here which need to check:

  1. Don't use "sudo". you don't need it, you already have the permissions to write stuff in your own home directory.

  2. You can easily view hidden files and directories in the graphical file manager by selecting View/Show Hidden Files from the menu. Or by pressing Ctrl-H.

  3. You need to use the "-R" option in the cp command to copy a directory and it's contents.

  4. /home isn't your home directory. /home/username is. So you are probably trying to copy from wrong place.

  5. The shell is case sensitive, so ~/downloads and ~/Downloads are two different things.

share|improve this answer

The message means that cp hasn't copied the directories listed. This is the default behaviour for cp - only files are copied normally, regardless of if you are specifying them explicitely or using *. If you want directories copying use the -r switch which means "recursive".

share|improve this answer
    
Thanks lot for your answer as well. :) –  MEM Apr 18 '11 at 15:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.