Linux command tail -f on Windows

0
(0)

Linux tail belongs to the GNU Core Utilities (Coreutils). It is a collection of basic command line commands that are included with most Linux OS.

First and foremost, tail is used to output the end of a (text) file, or to restrict the output of a Linux command to a certain area. The tail command is related to the head command and the cat and less commands. These Linux commands all serve one purpose of outputting the contents of text files.

PowerShell Get-Content -Wait -Tail

As used on Linux tail with the -f (–follow) option to follow the update of a log file in real time, but on Windows there is no tail command, for this Windows has the PowerShell command Get-Content, with the option – Wait -Tail a log file can be followed in real time, new lines that are written to the log file can also be displayed continuously under Windows.

PS C:\> Get-Content C:\inetpub\logs\LogFiles\W3SVC1\20230227.log -Wait -Tail 10

This example tracks the IIS log file in real time and outputs it to Windows 10 or Windows 11 PowerShell.

  The update is stopped when you click in the PowerShell window, the update stays in mark mode, the update is continued with hit Escape.

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Leave a Reply

Your email address will not be published. Required fields are marked *