Forrest logo
back to context overview

select-string

List of commands for select-string:

  • select-string:tldr:4f628 select-string: Search for an exact string (disables regular expressions).
    $ Select-String -SimpleMatch "${exact_string}" ${path\to\file}
    try on your machine
    explain this command
  • select-string:tldr:8fd14 select-string: Capture the specified number of lines before and after the line that matches the pattern.
    $ Select-String --Context ${2,3} "${search_pattern}" ${path\to\file}
    try on your machine
    explain this command
  • select-string:tldr:aa0ec select-string: Search for a pattern within a file.
    $ Select-String -Path "${path\to\file}" -Pattern '${search_pattern}'
    try on your machine
    explain this command
  • select-string:tldr:b9f4d select-string: Search stdin for lines that do not match a pattern.
    $ Get-Content ${path\to\file} | Select-String --NotMatch "${search_pattern}"
    try on your machine
    explain this command
back to context overview