Created
February 25, 2016 16:45
-
-
Save hperantunes/43daf6709f62571aaad2 to your computer and use it in GitHub Desktop.
tail + grep powershell equivalent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-Content C:\temp\mylogfile.log -tail 100 –wait | Select-String 'search' |
Thanks :D
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
Google brought me here faster than figuring it out myself.