Skip to content

Instantly share code, notes, and snippets.

@hperantunes
Created February 25, 2016 16:45
Show Gist options
  • Save hperantunes/43daf6709f62571aaad2 to your computer and use it in GitHub Desktop.
Save hperantunes/43daf6709f62571aaad2 to your computer and use it in GitHub Desktop.
tail + grep powershell equivalent
Get-Content C:\temp\mylogfile.log -tail 100 –wait | Select-String 'search'
@eizedev
Copy link

eizedev commented Jan 1, 2023

As a fast alternative for linux/unix grep you could also try the psitems powershell module. It includes a psgrep command (alias for Find-ItemContent) that works similar to the linux/unix grep command (the basic way, only a few parameters of original grep included).

Install-Module -Name PSItems
Import-Module -Name PSItems
psgrep 'test' -H -R 

(above command searches for pattern test in all files in current directory recursively (-R) and highlights the results (-H))

Fore more information check the README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment