tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* SUMMARY: Searching all files
@ 1997-08-08 10:04 Paul Key
  0 siblings, 0 replies; only message in thread
From: Paul Key @ 1997-08-08 10:04 UTC (permalink / raw)
  To: tru64-unix-managers

I have been inundated with responses to this question...thanks everybody -
too numerous to mention all your names.  There are so many ways to crack a nut!

Here are a few of the responses:


###################################################


From "Richard L Jackson Jr" <rjackson@portal.gmu.edu>

For example you want to search all files for the word fubar...

find / -type f -print -exec fgrep fubar '{}' \; >& /tmp/find.fubar

This says start searching from root, look at only files (not directories),
print searched filenames, execute fgrep for fubar, and send the results to
/tmp/find.fubar.  Finally, when find ends, scan the /tmp/find.fubar for
fubar and note the filenames it was found in.

-- 
Regards,
Richard Jackson
Computer Center Lead Engineer
Mgr, Central Systems & Dept. UNIX Consulting
University Computing & Information Systems (UCIS)
George Mason University, Fairfax, Virginia

###################################################


try this:

cd /
find . -print -exec grep 'string' {} \;
-- 
Gary Jarrell                  |  1-800-354-9000 x30374 
Digital UNIX Technology Group |  MailStop:  ALF1-3/Q28 
Digital Equipment Corporation |  E-Mail:  jarrell@alf.dec.com 
5555 Windward Parkway West    |  Alpharetta, GA  30201-7407

###################################################


Jie Gao <jgao@csu.EDU.AU>,  Matthew Norcross <matt@CS.Princeton.EDU> and Tom
Webster <webster@ssdpdc.mdc.com> sent in PERL scripts that do the job...I
have yet to find the time to try them out!

And one shell script from Dan West <dwest@ad3100.ada.epa.gov>

I use the following shell script to search all files below the current
directory for a string

#!/bin/sh
if test $# -eq 0
then
        echo "Usage: search string"
        exit
fi
echo "find . -type f -print | xargs fgrep $1 /dev/null"
find . -type f -print | xargs fgrep $1 /dev/null


###################################################


Thanks again for the response!

Paul



_____________________________________________________________________

    |R|         A Message from Paul Key: Reginet Systems Developer
    |E|                  at 
    |G|         The Institute of Public & Environmental Health,          
    |I|         The University of Birmingham,           
    |N|         http://www.hsrc.org.uk
    |E|         E-mail        	: Paul@hsrc.org.uk
    |T|         Telephone 	: 0 (+44) 121 456 5600 Ext. 59876     
    | | 	Fax / Messages 	: 0 (+44) 121 454 6876
______________________________________________________________________ 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1997-08-08 10:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-08-08 10:04 SUMMARY: Searching all files Paul Key

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox