I have a directory that contains quite a lot of files with names made up of 8 random letters, numbers, _ and -, e.g.:
0dckGYH5.jpg
32Pz5-WQ.png
32_17pxH.png
Hsf4BQW9.jpg
xh-fa3Nu.gif
zYtBEaKA.png
...
Now the task is to go through each of the files, create a directory named after the first 2 characters of the file's name, and move the file into that directory.
The final structure should look like this:
0d
└── 0dckGYH5.jpg
32
├── 32Pz5-WQ.png
└── 32_17pxH.png
Hs
└── Hsf4BQW9.jpg
xh
└── xh-fa3Nu.gif
zY
└── zYtBEaKA.png
Since I don't have permission to install anything on the system, how would I go about doing this with only basic shell commands?