Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 261
  • 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
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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