Skip to content

Instantly share code, notes, and snippets.

@innermond
Created April 3, 2018 15:03
Show Gist options
  • Save innermond/6bba70c5152b034ac7097825f29a93fa to your computer and use it in GitHub Desktop.
Save innermond/6bba70c5152b034ac7097825f29a93fa to your computer and use it in GitHub Desktop.
copy and rename a bunch of files
find . -name <Pattern for files from Source Directory> -type f -exec bash -c 'tmp="${1//[\/ ]/-}";cp "{}" <Destination>/${tmp:2}' _ {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment