ref: 65b0ebdaf6f1ebaf13633c0ac88b1efc6d18195e
dir: /sdrip/archive.rc/
#!/bin/rc ls *.JPG | awk -F_ '{ year=substr($1, 1, 4) month=substr($1, 5, 2) dirs[sprintf("%s/%s", year, month)] = 1 printf "mv -n %s /home/alex/img/%s/%s/%s\n", $0, year, month, $0 } END{ for(d in dirs) printf "mkdir -p /home/alex/img/%s\n", d }' | tac