Search Results

Search: Posts Made By: 35Soinc
9,308
Posted By 35Soinc
This code did serach the sub directories and...
This code did serach the sub directories and display the line in the file......BUT now does NOT include the file name containing the string :mad:

[unix] mark[24]: pwd
/home
[unix] mark[25]: find...
9,308
Posted By 35Soinc
the -ir gives me an error :( [unix]...
the -ir gives me an error :(

[unix] mark[449]: grep -ir 'monkey' *
grep: illegal option -- r
usage: grep [-E|-F] [-c|-l|-q] [-bhinsvx] -e pattern_list...
[-f pattern_file...] [file...]...
9,308
Posted By 35Soinc
I think that will work. The live test I did...
I think that will work. The live test I did locked me up.....but I think because it found the string in an executable file and tried to display it.

If I only wanted to search C source files...
9,308
Posted By 35Soinc
I didn't use the backsticks the first...
I didn't use the backsticks the first time.....but received another error when using them in which I needed to CNTL C out of.

I copied my cmd prompts this time. The first command shows the grep...
9,308
Posted By 35Soinc
not working
Thanks for the response Franklin.

That code gives an error :

grep: can't open find

It thinks find is a filename.
9,308
Posted By 35Soinc
Ok, I'm getting closer. I found a grep command...
Ok, I'm getting closer. I found a grep command that is somewhat working.......

grep -i 'string' *

This is giving me what I need, but is only searching the present directory.

How do I get...
9,308
Posted By 35Soinc
What is the Best way to search files for a string??
I'm looking to seach all the files in a directory and sub-directories looking for a string. When the string is found, I want to display the filename and the entire line of that file that the string...
Showing results 1 to 7 of 7

 
All times are GMT -4. The time now is 06:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy