21

I have a folder I just luckily recovered sitting on:

/media/sdc1/Pictures

with a BUNCH of subdirectories and files that I need.

I want to copy these to a folder on:

/media/sdb1/Pictures

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?

Zanna
  • 72,312
wardr
  • 2,429

3 Answers3

28

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/
amc
  • 7,292
12

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.
demure
  • 2,322
0

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

Kevin Bowen
  • 20,055
  • 57
  • 82
  • 84
RGS
  • 156