I have a huge collection of images and I would like to put them in folders matching their first 3 charachers+.jpg extension.
So i would like to grab 4_1_0002.png
file (all the files starting with 4_1) and put it in the 4_1_.jpg
folder. Similarly I would like to grab 4_2_0002.png
file (all the files starting with 4_2) and put it in the 4_2_.jpg
folder.
All those files that I would like to sort are now in one huge folder. I expected to use a find command, but I don't know how to extract the first three characters from {} expansion parameter.
find . -type f -ok echo mv {} "path/first3char.jpg" \;