LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to find a work within a folder full of text files? (https://www.linuxquestions.org/questions/linux-general-1/how-to-find-a-work-within-a-folder-full-of-text-files-319688/)

juanb 05-03-2005 09:21 AM

How to find a work within a folder full of text files?
 
Hi,

I need to find a work within a folder which has moltyple text files.

I need to search all those files for this word.

what is the command please?

I use RH.


THanks !

trevelluk 05-03-2005 09:27 AM

While in the directory concerned:

grep (search word) *

juanb 05-03-2005 11:01 AM

it takes ages
 
Hi,

I issued the command grep large*

cause im looking for a word which starts with "large"

the folder is only 3 mb of text files and it is working for more then 30 minutes to supply answers !!

Maybe the command froze? how can I caheck this ?

top dowsnt show this command...

tahnks !

trevelluk 05-03-2005 11:22 AM

There should be a space between the search word and the * (grep large *), which will search every file in the directory (that's what the * means), for the character string large (regardless of where it appears in the word).

I think what's happening without the space is that grep thinks you haven't given it a filename, and its waiting to take input from the console. To stop it, use Control-D.

jonaskoelker 05-03-2005 05:09 PM

btw, if your word starts with `large' and you know that it comes after, say, a space, you might want this:
$ grep ' large[^ ]* ' *
`[^ ]' means `anything except space.
`(something)*' (emphasis on `*') means (something) zero or more times.

rtm ;)

hth --Jonas


All times are GMT -5. The time now is 10:28 AM.