PDA

View Full Version : [ubuntu] Understanding the CP command..



NetDoc
April 26th, 2011, 07:13 PM
Which of these (if any) are correct?

cp -r /var/www/vhosts/niftyfiftyparty.com/httpdocs/sites/all/modules/*.* /var/www/vhosts/keylargodivecenter.com/httpdocs/sites/all/modules/*


in /var/www/vhosts/niftyfiftyparty.com/httpdocs/sites/all/modules/
cp -r *.* /var/www/vhosts/keylargodivecenter.com/httpdocs/sites/all/modules/*

in /var/www/vhosts/keylargodivecenter.com/httpdocs/sites/all/modules/
cp -r /var/www/vhosts/niftyfiftyparty.com/httpdocs/sites/all/modules/*.* *

Both the source and destination folders are valid. There are several folders in the niftyfiftyparty modules folder that I need in the other one. Thanks in advance.

cek
April 26th, 2011, 07:31 PM
cp -rpv /var/www/vhosts/niftyfiftyparty.com/httpdocs/sites/all/modules/* /var/www/vhosts/keylargodivecenter.com/httpdocs/sites/all/modules/



Will copy all files (recursively) from the first path to the second path, preserving names. Will also show what is being copied in the console window while copying (which can be helpful for troubleshooting any issues).

NetDoc
April 26th, 2011, 09:25 PM
So the problem I was having was using the *.* rather than just *

Thanks.