I have lots of files all of which are similar to the following:
frame1_M.png
frame1_S.png
frame1_L.png
frame1_N.png
frame1_D.png
frame1_M.png
frame1_S.png
frame1_L.png
frame1_N.png
frame1_D.png
frame2_M.png
frame2_S.png
frame2_L.png
frame2_N.png
frame2_D.png
frame3_M.png
frame3_S.png
frame3_L.png
frame3_N.png
frame3_D.png
How can I put all the items of frame1 in a directory made in the current directory named frame1, same goes with frame2 and rest of frames. As you see, in each group of files, only the frame number is common.
This is just an example. The files are in the range of 30k so needs to be done with terminal/bash. *Frame numbers are totally random in the real scenario not ordered so that makes it a very challenging task for me.
findcommand will do the work I guess. – Ravexina Apr 10 '17 at 23:30