View Single Post

   
  #7 (permalink)  
Old 01-05-2008, 06:03 AM
Stephane Gassies
 
Posts: n/a
Default Re: find command and excluding files under specific directories

A simple way is
find /opt | egrep -v '/opt/(jan|feb/logs|mar/outs)/'

But it uses two commands and a pipe sigh!
OBS: the trailing / does mots of the job ...

> shpot4@yahoo.com wrote:
>
> > Help with find and excluding files under specific directories.
> > For these specific dirs, I want to exclude all files under, but keep
> > the directory names.
> >
> > /opt/2004/jan
> > /opt/2004/feb/logs
> > /opt/2004/mar/outs
> >
> > Could someone please tell me the correct syntax I should use for my
> > find command? And don't tell me to read the man pages, because I've
> > done that!
> >
> > Cheers!

Reply With Quote