Below is an example of a Bash script that creates folders with the modification date of the files and moves the files to these folders:
#!/bin/bash
# diretório dos arquivos a serem movidos
dir='/caminho/para/os/arquivos'
# loop pelos arquivos no diretório
for file in "$dir"/*
do
# verifica...