![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Recursive FTP -- here at last. | Perderabo | Shell Programming and Scripting | 51 | 1 Day Ago 02:12 PM |
| Recursive grep | upstate_boy | UNIX for Dummies Questions & Answers | 16 | 05-18-2008 02:16 PM |
| recursive grep issue | Mace | UNIX for Dummies Questions & Answers | 1 | 08-11-2006 04:39 AM |
| grep recursive directories | jagannatha | UNIX for Dummies Questions & Answers | 8 | 07-24-2003 01:00 PM |
| Recursive FTP | aslamg | UNIX for Dummies Questions & Answers | 1 | 03-08-2001 01:27 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
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. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
|
|
#3
|
||||
|
||||
|
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
|
||||
|
||||
|
try this
fgrep */*/*/* 093023553
where * are your subdirectorys |
||||
| Google The UNIX and Linux Forums |
| Tags |
| grep, grep recursive, recursive grep |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|