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

gcloud CLI - Google Cloud Command Line Interface: Notes

"Google Cloud CLI (Command-Line Interface) is a set of tools that you can use to manage resources and applications hosted on Google Cloud. These tools include the gcloud , gsutil , and bq command-line tools."

Free SSL Certificate Authorities

Free SSL Certificate Authorities that really work for me. StartSSL, the Start of SSL Certificates https://startssl.com/ StartSSL, the Start of SSL Certificates Let’s Encrypt https://letsencrypt.org/ Let's Encrypt, a new free Certificate Authority

Demistify Buffer Overflow Vulnerability

Collection of articles, blog posts, lectures, tutorials... about Buffer Overflow Vulnerability.