X
X
The Best Tech Newsletter Anywhere

Join 250,000 subscribers and get a daily digest of news, geek trivia, and our feature articles.

How to Get Tail Like Functionality on Windows with PowerShell

image

Linux power users and administrators have long used the tail utility to monitor log files, but did you know that you can do the same on Windows?

Traditionally tail has been used to view the bottom X number of lines from a log file. While Windows doesn’t have a standalone utility to do what tail does, we do have the Get-Content PowerShell cmdlet which happens to have a tail parameter.

  Get-Content D:\log.txt -Tail 3

sshot-18

Other extremely popular use for tail is using it to monitor logs, when used in this manner the log entry is printed to the console every time something writes to the log. This can be accomplished using the wait parameter.

  Get-Content D:\log.txt –Wait

image

That’s all there is to it.

Taylor Gibb Taylor Gibb
Taylor Gibb is a professional software developer with nearly a decade of experience. He served as Microsoft Regional Director in South Africa for two years and has received multiple Microsoft MVP (Most Valued Professional) awards. He currently works in R&D at Derivco International.
Read Full Bio »

More Articles You Might Like

How-To Geek is where you turn when you want experts to explain technology. Since we launched in 2006, our articles have been read more than 1 billion times. Want to know more?