/ Published in: Bash
URL: http://www.linuxquestions.org/questions/showthread.php?t=7368
Expand |
Embed | Plain Text
find /var/log -mtime -14 -type f -exec ls -al {} \;
Comments
Subscribe to comments
You need to login to post a comment.

or, to remove all jpg's in the current directory older that two weeks:
$ find . -mtime +14 -type f -name "*.jpg" -exec rm -f {} \;
careful!
First, you need to quote the
{}as'{}'in order to prevent your shell from interpreting it. Second, you can just use the-deleteflag instead of yourrm -f '{}' \;after all.find /var/log -mtime -14 -type f -delete