How can i sort files in a folder for example user/images/
which contains files in this order list below, objective is not to print a list of file names which is sorted but to actually rearrange files by sorting in the above mentioned folder
Current order
1.jpg
5.jpg
3.jpg
4.jpg
2.jpg
Desired order
1.jpg
2.jpg
3.jpg
4.jpg
5.jpg