Article 5T7T8 Moving files script

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 :)latest?d=yIl2AUoC8zA latest?i=T2332jVONH8:xYZZNuLB5Ro:F7zBnMy latest?i=T2332jVONH8:xYZZNuLB5Ro:V_sGLiP latest?d=qj6IDK7rITs latest?i=T2332jVONH8:xYZZNuLB5Ro:gIN9vFw
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments