8

I am doing a data recovery for someone and enter the following command

-Ubuntu:~# cp /media/Macintosh\ HD/Users/orlando/Desktop\ (original)/VIDEOS\ ESPANOL/ /media/\$G\$\ DATA/Orlando/Desktop/ 

And it outputted this,

 cp: omitting directory `/media/Macintosh HD/Users/orlando/Desktop (original)/VIDEOS ESPANOL/'

By the way, I am logged in as root. What does this mean and how do I fix it?

1
  • 1
    If you doing data recovery you should check out rsync.
    – Dan
    Jun 17, 2014 at 19:03

1 Answer 1

15

The error notice means you told cp to copy files and not directories. The warning is about cp finding a directory and informing you it will be skipped.

If you want directories: cp -r means recursive and this option will make cp also include subdirectories.


So your command needs to be:

cp -r /media/Macintosh\ HD/Users/orlandocampoverde/Desktop\ ...

Regarding comment:

-u, --update
          copy only when the SOURCE file is  newer  than  the  destination
          file or when the destination file is missing
6
  • Thank you this worked I believe. Is there anyway to make it copy only things that aren't already there. For example this guy had Desktop and Desktop Old for some reason... I want to copy everything from Desktop Old but I want it to exclude all that were already there.
    – Zargold
    Jun 17, 2014 at 19:04
  • 1
    Although there is nothing wrong with cp -u, rsync is often used for this, although rsync has additional helpful features.
    – Panther
    Jun 17, 2014 at 19:08
  • 2
    I agree but if the options of cp are giving him trouble ... rsync has so many more :D
    – Rinzwind
    Jun 17, 2014 at 19:11
  • I installed ubuntu for the sole reason of helping me with this data backup. Windows and Mac OS were not able to see anything on this hard drive. So pretty new to all comamands. so cp -u will exclude anything I just copied?
    – Zargold
    Jun 17, 2014 at 19:13
  • 1
    yes cp -u will only "update" a file if not already completly copied (it will also repair a partly copied file)
    – Rinzwind
    Jun 17, 2014 at 19:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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