Moving files script
by hatfani from LinuxQuestions.org on (#5T7T8)
Hey,
I am using linux centos.
In this path /home/pics/all I have 31 folders from 01-31, for example: /home/pics/all/09.
All the files have the same format (year,month,day): 2021_12_1 which indicates the date of the photo.
I want to send each photo to its relevant folder.
I can easily use 31 if statements to move each file to its corresponding folder, by using the name of the photo.
However, I though maybe I can do it differently and more easily without writing 31 code lines of if statements. any Idea?
Thank you :)
I am using linux centos.
In this path /home/pics/all I have 31 folders from 01-31, for example: /home/pics/all/09.
All the files have the same format (year,month,day): 2021_12_1 which indicates the date of the photo.
I want to send each photo to its relevant folder.
I can easily use 31 if statements to move each file to its corresponding folder, by using the name of the photo.
However, I though maybe I can do it differently and more easily without writing 31 code lines of if statements. any Idea?
Thank you :)