We Recommend

bash Cookbook: Solutions and Examples for bash Users bash Cookbook: Solutions and Examples for bash Users
bash Cookbook teaches shell scripting the way Unix masters practice the craft. It presents a variety of recipes and tricks for all levels of shell programmers so that anyone can become a proficient user of the most common Unix shell -- the bash shell -- and cygwin or other popular Unix emulation packages.


Posted By

jhenry on 06/12/07


Tagged

time date command Shell script unix linux files line find


Versions (?)


Who likes this?

2 people have marked this snippet as a favorite

noah
alexxx


using find to list old files based on date


Published in: Bash 


URL: http://www.linuxquestions.org/questions/showthread.php?t=7368

  1. find /var/log -mtime -14 -type f -exec ls -al {} \;

Report this snippet 

Comments

RSS Icon Subscribe to comments
Posted By: jhenry on June 12, 2007

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!

You need to login to post a comment.