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

Database, schema, and table sizes in Greenplum

Greenplum update with multiple tables

Show running queries on Postgresql/Greenplum