This command will remove all files which older than 365 days. Be careful when you need to run this command. Before add "rm" use "ls" option to see that files..
- List all files older than 365 days.
#find /pathtofile -type f -mtime +365 -prune | xargs ls -ld
For Linux also;
#find /tmp -atime +365
- Remove all files older than 365 days.
#find /pathtofile -type f -mtime +365 -prune | xargs rm –r