LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices

Reply
 
Search this Thread
Old 08-28-2004, 03:47 AM   #1
yrraja
Member
 
Registered: Sep 2002
Distribution: RH, FC, Ubuntu, Solaris, AIX
Posts: 114

Rep: Reputation: 15
Using Grep to search all sub-directories


In linux if i want to seach for a pattern in all the files in all the sub-directories i can use somthing like

grep -r 'pattern' *

in solaris '-r' option is not recognised.... is there any alternate option/method that i can use to do this

Yrraja
 
Old 08-28-2004, 03:52 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,523

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
Either install the gnu version of grep or run:

find . -exec grep 'pattern' {} +
 
Old 08-28-2004, 04:29 AM   #3
yrraja
Member
 
Registered: Sep 2002
Distribution: RH, FC, Ubuntu, Solaris, AIX
Posts: 114

Original Poster
Rep: Reputation: 15
Thanx jlliagre.. it worked
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
To recursively search with grep grautu Slackware 5 11-21-2005 03:53 AM
can you specify which files to grep search? sneakyimp Linux - Software 4 10-12-2005 09:28 PM
How to search and replace a text using grep DediPlace Linux - General 2 05-29-2005 07:47 PM
grep search in zip/rar... etc plainkeyman Linux - Software 2 05-23-2005 07:05 PM
Grep for search, but what for replace? TheSpecial Linux - Software 18 04-28-2003 10:01 AM


All times are GMT -5. The time now is 09:26 PM.

Main Menu
Advertisement
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