Say you backup your database daily and you need to delete the old backup files.
You can issue the command bellow which will erase any files within the specified directory that are older than 7 days.
$ find /your/target/directory* -mtime +7 -exec rm {} \;