Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 258
  • Last Modified:

Search in UNIX; a simple question

New to UNIX.

I need to search for  this text;
'/u1/xxx/yyyy' in all the scripts residing in the system.

used the following command:

find . -type f -print | xargs grep -l -i '/u1/xxx/yyyy*'

Returned too many files.

is there any way I can exclude the files with extension '.log' and '.trc'
Looking for the command or a easy way to do this. It's AIX 4.2.

Thanks for the help.
0
iqbalj
Asked:
iqbalj
1 Solution
 
christgCommented:
I don't remember if it's good but you can try:
cd /
find . -print | grep '/u1/xxx/yyyy'
0
 
iqbaljAuthor Commented:
Edited text of question
0
 
iqbaljAuthor Commented:
Edited text of question
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
ozoCommented:
find . -type f \! -name '*.log' \! -name '*.trc'
0
 
rajanxyzCommented:
Use the following find command.  It will work.

First cd /
Then

find . -type f ! -name "*.log" ! -name "*.trc" -exec grep -i -l "/u1/xxx/yyyy*" \{\} \;


0
 
iqbaljAuthor Commented:
It is now listing all the files (even the Jpegs); I added  '-print' ; Now it looks like this

find . -type f ! -name "*.log" ! -name "*.trc"- print  -exec grep -i -l "/u1/app/oracle*" \{\} \;

I also get this error for some files:

grep: 0652-226 Maximum line length of 2048 exceeded
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now