Can't find what you're looking for? Use of one of the search websites below …

Home*nixos commandsfind

find

Published on Sunday, September 3, 2006

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 Responses to “find”

  1. Ben says:

    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 `

  2. remivisser says:

    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@

Leave a Reply