Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
'pattern' would be the word/sentence you're searching for.
Normally grep will output the matching lines from each file, which some (like me) don't find really useful without using the following options :
-n prints the matching line's number.
-l doesn't print the content, just only lists the files with matches found.
-c prints a list of searched files and the count of matches within each.
if you're searching in a directory that contains other directories you'll need to provide the option -r to search recursively. omit it to search the files *just* in this directory.
Also if you are searching within system files, some errors may be generated, so pass grep the option -s to suppress those errors.
last, if your pattern is just one word, you could type the word without any surrounding quotes, if it's sentence, you'll need to write it within double quotes ..
example : searching for "float x" in a source tree :
grep -r [-c -n -l] "float x" *
the asterisk '*' means "all files".
Experiment a little with it till you find the options that work for you.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.