Skip to main content

Powershell: Get-Content - tail command on Windows

Love tail command on Linux? Try Get-Content with Powershell 3.0+.

Powershell Get-Content

Example: Keep reading the last 20 lines from C:\Windows\WindowsUpdate.log file

PS C:\> Get-Content C:\Windows\WindowsUpdate.log -Tail 20 -Wait
Read 20 last line from C:\Windows\WindowsUpdate.log file
Read 20 last line from C:\Windows\WindowsUpdate.log file

Count how many lines in a text file

PS C:\> (Get-Content C:\Windows\WindowsUpdate.log).Count

Popular posts from this blog

hmailserver: Notes from the field

hmailserver is one of free open source mail servers running on Microsoft Windows operating system.

stegseek: Notes

StegCracker has been retired following the release of StegSeek, which will blast through the rockyou.txt wordlist within 1.9 second as opposed to StegCracker which takes ~5 hours.

Install Microsoft .NET Core SDK

.NET Core Software Development Kit (SDK) is a set of libraries and tools that allow developers to create .NET Core applications and libraries.