Sep 3, 2006
find
man: NAME: find – find files
Find/Remove old files
Find files modified more then 365 days ago;
find . -mtime +365 -exec ls -l {} \;
Use touch to test
$ touch -t 197801130300 oldfile
$ find . -mtime +365 -exec rm {} \;
$ ls oldfile
ls: oldfile: No such file or directory
2 Comments, Comment or Ping
Ben
If you have a couple of configuration files you need to edit to change a parameter. And you want to make sure you get them all.
Then find is also very handy combined with xargs
vi `find . -type f |xargs grep -l `
Jan 3rd, 2007
remivisser
Ben, you have got to be kidding me!!! Where are you these days.
Mijn grote voorbeeld leeft dus toch nog? !!
Ik heb uw voorbeeld gevold, hebt het juk van CMG afgeschud en ben gaan contracten. Bevalt uitsteekbaar, ik mail u!
remi@
Jan 3rd, 2007
Reply to “find”