Created
September 26, 2012 17:58
-
-
Save gabrielcarbone/3789523 to your computer and use it in GitHub Desktop.
This file contains 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 | |
IFS=$'\n' | |
for file in `ls -1 *.[jJ][pP][gG] *.[tT][hH][mM] *.[mM][pP][gG] 2>/dev/null`; | |
do | |
# Creo el directorio fecha YYYY_MM_DD | |
fecha=`date -r "$file" +%Y_%m_%d` | |
# Crear directorio sin error en caso de que exista | |
mkdir -p ./"$fecha" | |
# Mover archivo | |
mv -v ./"$file" ./"$fecha" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment