I have several hundred PDFs under a directory in UNIX. The names of the PDFs are really long (approx. 60 chars).
When I try to delete all PDFs together using the fol
Try this also If you wanna delete above 30/90 days (+) or else below 30/90(-) days files/folders then you can use the below ex commands
Ex: For 90days excludes above after 90days files/folders deletes, it means 91,92....100 days
find -type f -mtime +90 -exec rm -rf {} \;
Ex: For only latest 30days files that you wanna delete then use the below command (-)
find -type f -mtime -30 -exec rm -rf {} \;
If you wanna giz the files for more than 2 days files
find -type f -mtime +2 -exec gzip {} \;
If you wanna see the files/folders only from past one month . Ex:
find -type f -mtime -30 -exec ls -lrt {} \;
Above 30days more only then list the files/folders Ex:
find -type f -mtime +30 -exec ls -lrt {} \;
find /opt/app/logs -type f -mtime +30 -exec ls -lrt {} \;