Linux bash script to move images/filetypes to their directories

U have folder with subfolders full of images or other files with different extensions (filetypes) ?

and you want to for example move all .jpg to jpg folder all .png to png folder
example:
find .jpg in /path/to/images and move them into /path/to/images/jpg

this Linux bash script can do it:

# "This script asks for path/directory with various images or other file types.
# When provided path, it will find all images or other set file types and for each filetype create a log file with full paths of all filetype matching files.
# Then script will list contents of these log files and asks if images/filetypes should be moved to their own directories (like .jpg to jpg folder)
#
# Script can be executed also with bigger automation without prompts by adding parameters after script like:
# sh /path/to/this/script /path/to/images/folder"

by default it works with .jpg, .gif, .png , but one can edit and change file types
I made this script so after execution it do not do any harmfull action without asking.

- it asks for path where to do search
- it create log file for each file type (default jpg, gif, png) without asking
- it show these log files contents and asks if it should move files in set directory to filetype directories
example:
find .jpg in /path/to/images and move them into /path/to/images/jpg
nothing else is done