One of my friend asked to me how to delete the old backup files which are older than 1 month in linux. so i just found some ways to do it

To List all the files which exactly Seven days olders
find /path/to/directory -type f -mtime 7 -exec ls -ltr {} \;
To List all the files which are older than 7 days
find /path/to/directory -type f -mtime +7 -exec ls -ltr {} \;
To List all the files which are lesser than 7 days
find /path/to/directory -type f -mtime -7 -exec ls -ltr {} \;

To Delete files which are listed by any of the command, we just need replace the ls command with rm command.

To delete all the files which are older than one month(30 days)
find /path/to/directory -type f -mtime +30 -exec rm -f {} \;