Ubuntu – Copying files to a USB drive


Currently, i am trying to copy a directory with files that contain my works website from a Gentoo server to a USB drive. Ive combed through many pages of you youtube and google and cannot seem to get it to copy. Im sure there is something im dong wrong here, anyone have any ideas?

cp -r /opt/biweb/app/ /data/dev/sdb1/

Edit: mount points

Filesystem Size Used Avail Use% Mounted on
/dev/sda3  31G  31G  0     100% /
/dev/sda1  84m  9.5m 70m   12%  /boot

/dev/sdb1  68g 42g   23g   66%  /data

Best Answer

The command you want is:

cp -r /opt/biweb/app/* /dev/sdb1/

Don't forget the asterix (*)! The above command will copy everything in the /app folder into the /sdb1 folder.

If you want to copy the app folder itself into the destination, then do:

cp -r /opt/biweb/app /dev/sdb1/

The above has no trailing slash after "app". This will copy the app folder as well as its contents.

Related Question