Home » Infrastructure » Unix » grepping a database
grepping a database [message #97498] Fri, 28 June 2002 02:30 Go to next message
chriswhittaker
Messages: 2
Registered: May 2002
Junior Member
I am trying to locate all files that contain a certain string. I am sure i should be using grep, but how do i arrange it to look through all files within a directory for this string.
i.e. i am trying to serach for locate all files with the word cookiemonster in them so that i can remove this string from the files
Re: grepping a database [message #97500 is a reply to message #97498] Fri, 28 June 2002 06:07 Go to previous messageGo to next message
dennis
Messages: 31
Registered: June 1998
Member
Try this...to find all text filenames that have the string "cookiemonster" in it, working recursively from the directory called 'mydir':
find mydir -type f -exec grep -il cookiemonster {} ;

Dennis
Re: grepping a database [message #97502 is a reply to message #97498] Fri, 28 June 2002 12:58 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
If you have binary files, you could try prepping them for grep by using "strings". Not sure of the total command including find though...

strings my_bin_file | grep blah
Previous Topic: oracle script in background using nohup in Unix ??
Next Topic: Re: DBA Studio for Linux
Goto Forum:
  


Current Time: Fri Sep 25 02:37:20 CDT 2020