[COLUG] find command

Ethan Dicks ethan.dicks at gmail.com
Sat Oct 20 21:42:38 EDT 2007


On 10/21/07, Rob Robson <rob at rob-robson.com> wrote:
> Help,
>
> I need the syntax for the Linux 'find' command for this issue.
>
> I want to run a script in the working directory and all directories below it.
>     The script alters file names, etc.
>
> So I just want it to run in each directoy and move on.
>
> find    (next directory) (run) clean-up.sh

Try

find (top-level-dir-path) -type d -exec clean-up.sh {} \;

(where you replace "(top-level-dir-path)" with the name of the highest
level directory you want to clean up).

This assumes that clean-up.sh takes an arg for which dir to clean up.
It's not as easy if clean-up.sh only cleans your present directory.

-ethan


More information about the colug432 mailing list