Solved

Search in UNIX; a simple question

Posted on 1999-01-12
6
235 Views
Last Modified: 2013-12-06
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
Comment
Question by:iqbalj
6 Comments
 

Expert Comment

by:christg
Comment Utility
I don't remember if it's good but you can try:
cd /
find . -print | grep '/u1/xxx/yyyy'
0
 

Author Comment

by:iqbalj
Comment Utility
Edited text of question
0
 

Author Comment

by:iqbalj
Comment Utility
Edited text of question
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 84

Expert Comment

by:ozo
Comment Utility
find . -type f \! -name '*.log' \! -name '*.trc'
0
 

Accepted Solution

by:
rajanxyz earned 50 total points
Comment Utility
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
 

Author Comment

by:iqbalj
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now