Skip to content

Instantly share code, notes, and snippets.

@NeuroWinter
Created April 22, 2017 01:58
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 NeuroWinter/24dfd778d7a940bf544a0455e07b6e01 to your computer and use it in GitHub Desktop.
Save NeuroWinter/24dfd778d7a940bf544a0455e07b6e01 to your computer and use it in GitHub Desktop.
find . -type f -name \*.flac -printf "%h\n" |
sort -u |
while read -r dirname; do
new="../flac/$dirname"
echo mkdir -p "$new"
echo cp "$dirname"/*.flac "$new"
jpgs=("$dirname"/*.jpg)
[[ ${#jpgs[@]} -gt 0 ]] && echo cp "$dirname"/*.jpg "$new"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment