Created
July 15, 2015 19:32
-
-
Save thutterer/4ce4e6b4fea0800df48b to your computer and use it in GitHub Desktop.
Look in all subfolders for all files of certain types and dig them up
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [ $# -eq 0 ]; then | |
| echo "Usage: Provide file extensions as arguments" | |
| exit 1 | |
| fi | |
| for ext in "$@" | |
| do | |
| for subdir in *; do [ -d "${subdir}" ] && mv ${subdir}/*.${ext} .; done | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment