remidian.com

play Mount of Olives

remidian is remi visser, oracle dba contractor from the Netherlands you can browse my work related braindumps, read my resume or contact me

home *nix os commands

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

  1. 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 `

  2. 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@

Reply to “find”