Segregate Photos based on date in following folder structure:

Year
|
|->Month
   |
   |->photos1.jpg
   |->photos2.jpg
   |->photos3.jpg

Examples:

2017
|
| -> 09
     |
     | -> photos1.jpg
     | -> photos2.jpg

Useful commands:

  • ls
  • cat
  • for loop
  • echo

Command to run the script

bash -f segregate.sh

Learn more about bash here

Bash Reference Manual