From LedHed's Wiki
Revision as of 00:16, 15 September 2016 by Ledhed (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Overview

Sometimes Linux Admins have to do stuff on Windows, and you curse Microsoft because they don't have Grep and Tail. Well PowerShell gives you similar functionality (albeit more complicated/less intuitive).


Command

Get-Content -Path c:\Windows\debug\netlogon.log -Tail 1 -Wait | Select-String "SomeUser" > c:\temp\someuser_netlogon.txt

Translation:

tail -f /windows/debug/netlogon.log | grep SomeUser > /tmp/SomeUser_netlogon.txt


Enjoy!