![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | grep -r equiv Hi, What is the preferred method to doing the equivalent of "grep -r". I tried: get-childitem *.ps1 | get-content | select-string "somestring" but it seems to only get the top level .ps1 sripts. thanks in advance, |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: grep -r equiv this should work. This will list every file and add the lines if found.. you can change that of course. get-childitem *.ps1 -recurse | %{get-content $_.FullName;Write-Host $_.FullName} | select-string "somestring" "Frank" <Frank@discussions.microsoft.com> wrote in message news:EA70370B-B79A-4015-A77D-A80DEE37319B@microsoft.com... > Hi, > > What is the preferred method to doing the equivalent of "grep -r". I > tried: > > get-childitem *.ps1 | get-content | select-string "somestring" but it > seems > to only get the top level .ps1 sripts. > > thanks in advance, > > |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: grep -r equiv That does not appear to work. I purposely put subdirs there and I had to do: get-childitem *\*.ps1 -recurse to find them. What gives? "Brandon Shell" wrote: > this should work. This will list every file and add the lines if found.. you > can change that of course. > > get-childitem *.ps1 -recurse | %{get-content $_.FullName;Write-Host > $_.FullName} | select-string "somestring" > > "Frank" <Frank@discussions.microsoft.com> wrote in message > news:EA70370B-B79A-4015-A77D-A80DEE37319B@microsoft.com... > > Hi, > > > > What is the preferred method to doing the equivalent of "grep -r". I > > tried: > > > > get-childitem *.ps1 | get-content | select-string "somestring" but it > > seems > > to only get the top level .ps1 sripts. > > > > thanks in advance, > > > > > > |
My System Specs![]() |
| | #4 (permalink) |
| Guest | Re: grep -r equiv get-childitem requires path (at least as far as I can tell) for recursion. What I did was: get-childitem $mypath *.ps1 -recurse "Frank" <Frank@discussions.microsoft.com> wrote in message news:0AC67253-E72D-492B-8DD3-57D411F3F50E@microsoft.com... > That does not appear to work. I purposely put subdirs there and I had to > do: > > get-childitem *\*.ps1 -recurse > > to find them. What gives? > > > > "Brandon Shell" wrote: > >> this should work. This will list every file and add the lines if found.. >> you >> can change that of course. >> >> get-childitem *.ps1 -recurse | %{get-content $_.FullName;Write-Host >> $_.FullName} | select-string "somestring" >> >> "Frank" <Frank@discussions.microsoft.com> wrote in message >> news:EA70370B-B79A-4015-A77D-A80DEE37319B@microsoft.com... >> > Hi, >> > >> > What is the preferred method to doing the equivalent of "grep -r". I >> > tried: >> > >> > get-childitem *.ps1 | get-content | select-string "somestring" but it >> > seems >> > to only get the top level .ps1 sripts. >> > >> > thanks in advance, >> > >> > >> >> |
My System Specs![]() |
| | #5 (permalink) |
| Guest | Re: grep -r equiv "Frank" > > What is the preferred method Preferred? ![]() > to doing the equivalent of "grep -r". > Well since grep is a process then perhaps doing the same is running another process too! ![]() PS> LogParser -h -i:textline | select-string "recurse" -recurse <level> : Max subdirectory recursion level (0=no recurse, -1=all levels) PS> LogParser "SELECT Text FROM '$pwd\*' WHERE Text LIKE '%recurse%' " -i:textline -recurse:" -1" -rtp:5 -stats ffText -------------------------------------------- ESC " -i:fs -recurse:0 -rtp:" -1" -stats ff-i:fs -recurse:0 -rtp:" -1" -stats ffJust another way! |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Find and GREP | swyck | PowerShell | 3 | 12-19-2007 02:45 PM |
| Grep | Waz | Vista file management | 3 | 05-13-2007 10:23 PM |
| unix equiv wc -l and /dev/null | Frank | PowerShell | 9 | 02-19-2007 11:10 AM |
| sfc /scannow or equiv in Vista? | Peter | Vista performance & maintenance | 5 | 06-28-2006 07:09 PM |