SEARCH

BYTE SIZE TIPS / QUICK, HELPFUL TIPS

How-To Geek

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 is a Microsoft MVP and all round geek, he loves everything from Windows 8 to Windows Server 2012 and even C# and PowerShell. You can also follow him on Google+

  • Published 03/23/13

RECOMMENDED POSTS

Get Free Articles in Your Inbox!

Join 134,000 newsletter readers

Email:

Go check your email!