Use rsync to copy a directory structure

To copy the directory structure only without copying any files:

rsync -a -f"+ */" -f"- *" source destination/

If you don't put the trailing / on source you'll get the source directory created in destination. If you put the trailing / after source, you'll get all of the subdirectories of source created in destination without the top source directory.

Source

Comments

Popular posts from this blog

OS X right side of menu bar frozen

rsync to SD card recopying files

Database, schema, and table sizes in Greenplum