Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-15-2003, 07:38 PM   #1
LQ Newbie
Registered: Sep 2003
Location: Northridge-California-USA
Distribution: Redhat
Posts: 10

Rep: Reputation: 0
Find string pattern in directory of text files

I'm looking for the command that searched every file in a particular directory for the string "". I just want file names and path returned it doesn't have to return the line number or anything, but its ok if it does return extra info.
Old 10-15-2003, 07:42 PM   #2
LQ Newbie
Registered: May 2003
Location: In front of the monitor
Posts: 16

Rep: Reputation: 0
The command you are looking for is GREP. Try "man grep" at the command prompt or you can look up the command online at:
Old 10-15-2003, 08:19 PM   #3
Senior Member
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304

Rep: Reputation: 65
grep "text to match" *.txt
change the *.txt to whatever you want, or just *
you can have it just list the path and filename or whatever you
wish with other options.


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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to replace string pattern with multi-line text in bash script? brumela Linux - Newbie 6 04-21-2011 06:56 AM
Python: find defined text string in a file, and replace the whole line Dark Carnival Programming 6 05-22-2007 06:02 AM
How to recursively rename files using their directory name pattern ceg4048 Linux - General 2 09-28-2005 01:16 PM
renaming text files based upon a pattern in their content Spacepup Linux - General 1 07-28-2005 01:43 PM
How to find a string in a directory? iclinux Linux - Newbie 2 07-02-2005 08:20 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:16 AM.

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