Last Updated on
Monitoring log files from a Windows PowerShell prompt can be just as convenient as using bash for this activity. The following commands will output an active display of a live log file.
Where the integer represents the number of lines to display in the buffer. Wait instructs the command to load new lines as they are written to the file.
Get-Content -Path "c:\example.log" -Wait -Tail 10
you can alternatively write this expression using the cat command:
# Print whole file and wait for appended lines and print them
cat "c:\example.log" -Wait
# Print last 10 lines and wait for appended lines and print them
cat "c:\example.log" -Tail 10 -Wait