If you want to copy the directory structure without any files, you can use following command.
If you want to copy the directory structure without any files from one host to another. You can use
Suppose I want to copy the directory structure of /etc in /root/tmp on same host.
rsync -av --include '*/' --exclude '*' /path/source/dir /path/destination/dir'rsync' gives you utility to copy directory with files or without files.
If you want to copy the directory structure without any files from one host to another. You can use
rsync -av --include '*/' --exclude '*' /path/source/dir user@host:/path/destination/dirExamples:
Suppose I want to copy the directory structure of /etc in /root/tmp on same host.
rsync -av --include '*/' --exclude '*' /etc /root/tmpIt will copy all directories of /etc in the /root/tmp without any files.
It will not create directory etc in the /root/tmp. It will start from sub-directories of etc.