Skip to content

Instantly share code, notes, and snippets.

@LongYC
Last active June 13, 2018 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LongYC/824f4643980ae563c098 to your computer and use it in GitHub Desktop.
Save LongYC/824f4643980ae563c098 to your computer and use it in GitHub Desktop.
Copy all files with specified extension from a source directory and its subdirectories into a destination directory.
# chmod 755 copyflat.sh
# ./copyitune.sh m4a /my/iTune/ /my/destination/
# $1 = file extension.
# $2 = source directory.
# $3 = destination directory.
echo "Copy all $1 files in $2 to $3"
find $2 -name "*.$1" -exec cp {} $3 \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment