Skip to content

Instantly share code, notes, and snippets.

@innermond
Last active June 15, 2017 12:21
Show Gist options
  • Save innermond/80960a0d2496e1c8a2a3e5733292a8fb to your computer and use it in GitHub Desktop.
Save innermond/80960a0d2496e1c8a2a3e5733292a8fb to your computer and use it in GitHub Desktop.
find files into a source directory according with a regex pattern and mass copy them to a destination directory while keeping source directory structure
find <src>/ -type f -regextype posix-extended -regex '^<pattern>$' -print0 | xargs -0i cp --parents "{}" <dest>/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment