Create a Duplicate copy of domain

What is the easiest way on Dreamhost to create an exact copy of an existing domain, ie; dev.mydomain.com is a duplicate copy of www.mydomain.com

I have already set the database up on the dev site, but i need to move the files into it. Ftp and download hundreds of files and structure or is there a simple way to copy all folders and put them in there, with overwrite? otherwise ftp will take hours.

Then I started thinking maybe there is some way to just click a button and get a duplicate copy of the entire domain.

Thanks

log into a shell prompt

$ cp -R mydomain.com dev.mydomain.com

assuming the dev. site is using the same user on the server.

Thank you.so assuming there is already some stuff in the dev.mydomain.com site, will it just overwrite the files there?

yes… but it will also leave extras

$ rm -rf dev.mydomain.com

first if you want to make sure it’s clean… be careful with rm -rf it’s powerful =]