linux - Find especific directory and ignore other -
i need find iplanets on 1 server , thinking use command:
find / type d -name https-* | uniq
but @ same time need ignore directories/file. i've been trying use !
, not work. have command this:
find / type d -name https-* ! -name https-admserv* ! -name conf_bk* ! -name alias* ! -name *db* ! -name classcache* | uniq
i need ignore that. directories admserv
, conf_bk
, alias
, tmp
, files *.db*
need find this:
/opt/mw/iplanet/https-daniel.com /opt/https-daniel1.com /apps/https-daniel2.com
i need find directory name. how can ignore other stuff?
thanks
use -prune
keep recursing directories:
find / \( -type d \( -name 'https-admserv*' -o -name 'conf_bk*' -o -name 'alias*' -o -name 'tmp' \) -prune -o -type d -name 'https-*' -print
there's no need ignore files. you're selecting https-*
directories, else ignored.
and there's no need pipe uniq
, since find
never produces duplicates.