Skip to content

Instantly share code, notes, and snippets.

@kencoba
Created June 15, 2017 07:30
Show Gist options
  • Save kencoba/88b9565916ce6d78c336e335f3dce326 to your computer and use it in GitHub Desktop.
Save kencoba/88b9565916ce6d78c336e335f3dce326 to your computer and use it in GitHub Desktop.
copy directory tree. exclude files.
#!/usr/bin/env zsh
if [ $# -ne 2 ]; then
echo "$# args specified" 1>&2
echo "usage: sh ./copyDir.sh from_directory to_directory" 1>&2
exit 1
fi
from_dir=$1
to_dir=$2
rsync -avz --include "*/" --exclude "*" $from_dir/* $to_dir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment