Operating System - HP-UX
1834785 Members
2571 Online
110070 Solutions
New Discussion

Re: "find" command -- Please "find" that for me !

 
Amit Kureel
Advisor

"find" command -- Please "find" that for me !

I am running following command to prepare a list, but the problem is that "find" is also taking the directory "bin" that I don't want. Can anybody point out the error in the script.

find ./ \( ! \( -name 'core' -o -name '*.bk' -o -name '*.c' -o -name '*.err' -o -name '*
.exec' -o -name '*.out' -o -name '*.bak' -o -name '*.dbg' -o -name '*.LOG' -o -name '*.log' -o -n
ame '*.old' \) \) -print \( -type d \( -name Mail -o -name bin -o -name dat -o -
name log -o -name settlerep -o -name tmp \) \) -prune > ./file.lst

Thanks and regards

Amit Kureel
3 REPLIES 3
federico_3
Honored Contributor

Re: "find" command -- Please "find" that for me !

what is current directory from which the search begins?
Joseph Chakkery
Valued Contributor

Re: "find" command -- Please "find" that for me !

Hello,

I assume u want to exclude /usr/bin which is a link in root directory. then use
find ./ | grep -v "./usr/bin"|to ur script.

If u want to avoid bin in current directory then find ./ |grep -v "./bin" | ur script.

U can use even multiple grep -v options if u want.

Hope this may help u.

Regards
Joe.
Knowledge is wealth
Joseph C. Denman
Honored Contributor

Re: "find" command -- Please "find" that for me !

I believe if you take out the

-o -name bin

you should be ok

...jcd...
If I had only read the instructions first??