Welcome to the most active Linux Forum on the web.
Go Back > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.


  Search this Thread
Old 08-28-2004, 02:47 AM   #1
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

Old 08-28-2004, 02:52 AM   #2
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.3, Oracle Linux, Mint
Posts: 9,669

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

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

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


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 02:53 AM
can you specify which files to grep search? sneakyimp Linux - Software 4 10-12-2005 08:28 PM
How to search and replace a text using grep DediPlace Linux - General 2 05-29-2005 06:47 PM
grep search in zip/rar... etc plainkeyman Linux - Software 2 05-23-2005 06:05 PM
Grep for search, but what for replace? TheSpecial Linux - Software 18 04-28-2003 09:01 AM

All times are GMT -5. The time now is 04:40 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration