Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a folder I just luckily recovered sitting on:


with a BUNCH of subdirectories and files that I need.

I want to copy these to a folder on:


What command do I have to use in the terminal to make sure this happens? I know there is the cp command. But is that the best choice? And if so what options should I use to ensure I get every single directory and file?

share|improve this question
up vote 9 down vote accepted

I would use rsync for this so that if there is an error (or you need to stop copying) partway through you can easily resume later, without having to recopy everything.

rsync -av /media/sdc1/Pictures/ /media/sdb1/Pictures/
share|improve this answer
I'd remove the * since it will omit dotfiles at the first level. It may also cause it to exceed the ARG_MAX limit. – geirha Jun 1 '13 at 9:31
@geirha good point. edited. – amc Jun 1 '13 at 18:09
great I will do this, thanks everyone – wardr Jun 1 '13 at 20:38

cp -r /media/sdc1/Pictures/* /media/sdb1/Pictures/some_dir

  • The -r is recursive, read the man page...
  • With /media/sdc1/Pictures/* the asterisk is to copy all the contents of /media/sdc1/Pictures/, but not the parent directory itself.
  • The some_dir of /media/sdb1/Pictures/some_dir is where you want to put it.
share|improve this answer

If you need an exact image, use the command dd if=(path) of=(path)

share|improve this answer

Your Answer


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.