Skip to content

Instantly share code, notes, and snippets.

@damienstanton
Last active August 29, 2015 14:18
Show Gist options
  • Select an option

  • Save damienstanton/50de33ff3a93c6b48642 to your computer and use it in GitHub Desktop.

Select an option

Save damienstanton/50de33ff3a93c6b48642 to your computer and use it in GitHub Desktop.
#!/bin/bash
for file in *.mp3 *.wav; do
year=$(echo $file | cut -c9-12)
month=$(echo $file | cut -c13-14)
day=$(echo $file | cut -c15-16)
mkdir -p "$year/$month/$day/"
mv "$file" "$year/$month/$day/"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment