Visit Jeremy's Blog.
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 01-09-2005, 12:44 AM   #1
Registered: Jun 2003
Location: Canada
Distribution: suse 9.2
Posts: 582

Rep: Reputation: 30
searching inside text files

Is it possible to search a bunch of text files within a directory for a specific string?
Old 01-09-2005, 12:50 AM   #2
Registered: Nov 2004
Location: BIOS
Distribution: RHEL3.0, FreeBSD 5.x, Debian 3.x, Soaris x86 v10
Posts: 379

Rep: Reputation: 30
Use grep, for example to search string xyz in /etc directory
grep "xyz" /etc/*
To search all subdires in /etc add r

grep -r "xyz" /etc/*
Old 01-09-2005, 12:56 AM   #3
Registered: Jun 2003
Location: Canada
Distribution: suse 9.2
Posts: 582

Original Poster
Rep: Reputation: 30
Great thanks!


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
text searching sopiaz57 Linux - Software 4 06-02-2005 02:00 PM
Using [code] inside of [color] results in very small text scuzzman LQ Suggestions & Feedback 1 03-28-2005 03:14 AM
Firefox searching in edit text boxes Muzzy Linux - Software 0 01-25-2005 04:14 PM
Searching text files by content will103 Linux - Software 1 01-24-2005 08:43 AM
Searching a text file - complicated cyph3r7 Linux - General 2 12-16-2003 11:45 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:28 PM.

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