Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 522 Bytes

tailing-a-file.md

File metadata and controls

17 lines (12 loc) · 522 Bytes

Tailing a file

Powershell has a Get-Content (or cat) command to read the contents of an item at a specified location. Among its flags are -Tail <Int32> and -Wait:

$ Get-Content file.txt -Tail 10 -Wait

This will read the contents of the file, print the last 10 lines and wait for more lines to be written to the file. In Linux this is equivalent to:

$ tail file.txt -n 10 -f

docs