Rectangle 27 0

PS> $files = Get-ChildItem -Recurse | 
       Select-String 'SomeSearchString' | 
       %{$_.path}  | 
       Select -Unique
PS> tf edit $files

grep - What is the PowerShell equivalent to this Bash command? - Stack...

powershell grep xargs
Rectangle 27 0

ls -r | select-string 'SomeSearchString' | Foreach {tf edit $_.Path}

or in a more canonical Powershell form:

Get-ChildItem -Recurse | Select-String 'SomeSearchString' | 
    Foreach {tf edit $_.Path}

and using PowerShell aliases:

gci -r | Select-String 'SomeSearchString' | %{tf edit $_.Path}

grep - What is the PowerShell equivalent to this Bash command? - Stack...

powershell grep xargs
Rectangle 27 0

I'm not familiar with grep but with Select-String you can do:

Get-ChildItem filename.txt | Select-String -Pattern <regexPattern>

You can also do that with Get-Content:

(Get-Content filename.txt) -match 'pattern'

PowerShell equivalent to grep -f - Stack Overflow

powershell grep
Rectangle 27 0

Correct. PowerShell is not a clone of *nix shells' toolset.

However it is not hard to build something like it yourself:

$regexes = Get-Content RegexFile.txt | 
           Foreach-Object { new-object System.Text.RegularExpressions.Regex $_ }

$fileList | Get-Content | Where-Object {
  foreach ($r in $regexes) {
    if ($r.IsMatch($_)) {
      $true
      break
    }
  }
  $false
}

PowerShell equivalent to grep -f - Stack Overflow

powershell grep
Rectangle 27 0

In Windows, you can use Powershell commands for a grep equivalent.

How to show lines of a text file that contain a certain keyword - CMD ...

batch-file command-line types cmd
Rectangle 27 0

The -Pattern parameter in Select-String supports an array of patterns. So the one you're looking for is:

Get-Content .\doc.txt | Select-String -Pattern (Get-Content .\regex.txt)

This searches through the textfile doc.txt by using every regex(one per line) in regex.txt

Also, PowerShell tab completion will make commands properly capitalized, so it is not hard to input.

PowerShell equivalent to grep -f - Stack Overflow

powershell grep
Rectangle 27 0

I was hoping that Powershell had the equivalent of grep,ls,less, xargs, et

In the case you missed this question (top voted) you might enjoy this answer.

windows - How can I view a log file from powershell console ? (i.e. po...

windows powershell less
Rectangle 27 0

[regex]$regex = (get-content <regex file> |
foreach {
          '(?:{0})' -f $_
        }) -join '|'

Get-Content <filespec> -ReadCount 10000 |
 foreach {
           if ($_ -match $regex)
             {
              $true
              break
             }
         }

PowerShell equivalent to grep -f - Stack Overflow

powershell grep