Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- for file in *
- do
- month="$(stat -c %y "$file"|cut -d\- -f2)"
- day="$(stat -c %y "$file"|cut -d\- -f3|awk '{print $1}')"
- mkdir -p ./$month/$day
- echo "Moving $file to ./$month/$day..."
- mv "$file" "./$month/$day/"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement