LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 05-03-2005, 08:21 AM   #1
juanb
Member
 
Registered: May 2002
Posts: 401

Rep: Reputation: 30
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 !
 
Old 05-03-2005, 08:27 AM   #2
trevelluk
Member
 
Registered: Nov 2003
Location: Bristol, UK
Distribution: Debian Lenny, Gentoo (at work)
Posts: 388

Rep: Reputation: 32
While in the directory concerned:

grep (search word) *
 
Old 05-03-2005, 10:01 AM   #3
juanb
Member
 
Registered: May 2002
Posts: 401

Original Poster
Rep: Reputation: 30
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 !
 
Old 05-03-2005, 10:22 AM   #4
trevelluk
Member
 
Registered: Nov 2003
Location: Bristol, UK
Distribution: Debian Lenny, Gentoo (at work)
Posts: 388

Rep: Reputation: 32
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.

Last edited by trevelluk; 05-03-2005 at 10:24 AM.
 
Old 05-03-2005, 04:09 PM   #5
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 46
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

Last edited by jonaskoelker; 05-03-2005 at 04:11 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find files containing specific text? SurfTurtle Linux - Newbie 7 01-05-2008 05:57 AM
linux 'find' to find text files subu_s Programming 2 12-02-2004 02:56 AM
find files in text-only? orange400 Linux - General 2 05-27-2004 07:50 AM
Find string pattern in directory of text files magnum818 Linux - Newbie 2 10-15-2003 08:19 PM
How to find text in a set of files? concoran Linux - General 2 06-01-2003 07:36 PM


All times are GMT -5. The time now is 05:41 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration