The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Recursive FTP -- here at last. Perderabo Shell Programming and Scripting 52 03-25-2009 12:15 PM
Recursive grep upstate_boy UNIX for Dummies Questions & Answers 16 05-18-2008 05:16 PM
recursive grep issue Mace UNIX for Dummies Questions & Answers 1 08-11-2006 07:39 AM
grep recursive directories jagannatha UNIX for Dummies Questions & Answers 8 07-24-2003 04:00 PM
Recursive FTP aslamg UNIX for Dummies Questions & Answers 1 03-08-2001 04:27 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-21-2003
alan's Avatar
alan alan is offline
Registered User
  
 

Join Date: Jul 2003
Location: Los Angeles
Posts: 53
recursive GREP ?

Hi! Suppose I have a directory (no symbolic links) called /WORK that contains 3 subdirectories:
/A
/B
/C

My problem is this: I want to look for a file that contains an order number. So far, I obtain what I want by doing this

[acb@k9]/home/acb% cd /WORK/A
[acb@k9]/home/acb/WORK/A% grep '093023553' *.*
[acb@k9]/home/acb/WORK/A% cd ..
[acb@k9]/home/acb% cd /WORK/B
[acb@k9]/home/acb/WORK/B% grep '093023553' *.* ...etc

There's got to be a better way to do that, right? I believe I could do something like this to scan all my subdirectories:

[acb@k9]/home/acb/WORK/A% grep -"recursive" '093023553' *.*

Is GREP not suited for that? Should I use FIND instead?

Thanks in advance for helping!

Al.
  #2 (permalink)  
Old 08-21-2003
sssow sssow is offline
Registered User
  
 

Join Date: Aug 2001
Posts: 179
Take a look at the following thread

grep recursive directories
  #3 (permalink)  
Old 08-21-2003
alan's Avatar
alan alan is offline
Registered User
  
 

Join Date: Jul 2003
Location: Los Angeles
Posts: 53
Thanks, sssow! I used

find . -exec grep -l '093023553' {} \; -exec grep '093023553' {} \;

and it did a great trick: listed my files containing my order number and the location of my order number in the files themselves!!!

Thank you!!

Al.
  #4 (permalink)  
Old 08-22-2003
pressy's Avatar
pressy pressy is offline Forum Staff  
solaris cultist
  
 

Join Date: Aug 2003
Location: Vienna / Austria (Europe) [EARTH]
Posts: 726
try this

fgrep */*/*/* 093023553
where * are your subdirectorys
Closed Thread

Bookmarks

Tags
grep, grep recursive, recursive grep

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:16 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0