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...
Now I'm watching your video and seeing that you explain this variable problem, I'm going to see if I get it, thank you very much. I have subscribed to your YouTube channel