copy directory structure copy files with directories
Q. How can I copy a directory tree without copying files?
A. Enter the root of the tree you want to copy. The tree will be recreated under /destination/
$ find -type d | xargs -i mkdir -p /destination/{}
Q. How can I copy the files and recreate the directory tree the file is in. I.E. copy the file along with the whole or part of the directory tree.
A. Enter the folder you want to be the root of the copied tree. Suppose I have /home/me/work/urgent/files/x.htm copied to /destination/ starting from me/ folder. Enter /home/ and type:
$ echo me/work/urgent/files/x.htm | cpio -pdvm /destination/
#search for files and copy all found with their dir trees
$ find . -name *.htm |cpio -pdvm /destination/
alternative link download