I want to copy the directories into another server; however don't need to copy the files of the directories. So a tar of empty directories is the one that I am looking for.
How to create a tar of directory structure
tar
Use cpio, not tar for this. First, cd to the top level directory you want to copy. find . -type d -print0 | cpio -o -0 >/tmp/archive.cpioThen copy /tmp/archive.cpio to your remote host. You can do it in one step:find . -type d -print0 | cpio -o -0 | ssh user@remotehost cd targetdir; cpio -iBy the way, the -print0 and -0 options are useful/needed when filenames contain non-printable characters, ie, newlines.