Advertisement
deeejay

Bash - Find and delete files older than two days

Nov 25th, 2014
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.16 KB | None | 0 0
  1. List files:
  2. find /var/www/html/root/Files/test_rm/*.pdf -mtime +1 -exec ls {} \;
  3.  
  4. Remove files:
  5. find /var/www/html/root/Files/test_rm/*.pdf -mtime +1 -exec rm {} \;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement