To find and move all files older than a given age use this command:
# -type f = only files, not directories
# -mmin +5 = modified over 5 minutes ago
# -exec = command to execute on each matched file
# {} = substitute for filename
# \; = end of command to execute
find /home/chris/newfiles -type f -mmin +5 -exec mv {} /home/chris/oldfiles \;
# -mmin +5 = modified over 5 minutes ago
# -exec = command to execute on each matched file
# {} = substitute for filename
# \; = end of command to execute
find /home/chris/newfiles -type f -mmin +5 -exec mv {} /home/chris/oldfiles \;
To use different age criteria:
# -mmin = minutes since modification
# -mtime = days since modification
# +10 = older than 10 time units
# -10 = less than 10 time units
# -mtime = days since modification
# +10 = older than 10 time units
# -10 = less than 10 time units