# Creates the 'bar' directory, as well as 'foo' and 'baz' if they don't already exist
mkdir -p '~/foo/baz/bar'
# create a directory in the current directory called penguin
rsync -a ./from ./to --include \*/ --exclude \*
Copy directory structure without files
# Create a directory and set permissions in octal notation
mkdir -m 775 test