I had a log directory with over 15000 entries from a period of over two years. My task was to move all but the most recent logs into a subfolder. I achieved this using the find command like so:
# cd /path/to/logs
# find . -maxdepth 1 -type f -mtime +90 -exec mv {} old_unprocessed/ \;
Reading from left to right this command searches through the current directory without descending into any subdirectories, looks for regular files with a ‘date last modified’ attribute of 90 days or more ago, and for each file found moves it into the subfolder called ‘old_unprocessed’.