Skip to content

Instantly share code, notes, and snippets.

@ik5
Last active December 22, 2015 19:39
Show Gist options
  • Save ik5/6521481 to your computer and use it in GitHub Desktop.
Save ik5/6521481 to your computer and use it in GitHub Desktop.
Take wav files from current directory and place them in directories based on month and day
#!/bin/bash
for i in *wav ; do
date=$(stat -c '%y' $i | cut -f 1 -d ' ' )
dir="${date:5:2}/${date:8:2}"
echo "$date $dir $i"
mkdir -p $dir
mv $i $dir
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment