Unix tail equivalent command in Windows Powershell

后端 未结 13 1678
攒了一身酷
攒了一身酷 2020-11-28 00:13

I have to look at the last few lines of a large file (typical size is 500MB-2GB). I am looking for a equivalent of Unix command tail for Windows Powershell. A f

13条回答
  •  温柔的废话
    2020-11-28 00:41

    Just some additions to previous answers. There are aliases defined for Get-Content, for example if you are used to UNIX you might like cat, and there are also type and gc. So instead of

    Get-Content -Path  -Wait -Tail 10
    

    you can write

    # Print whole file and wait for appended lines and print them
    cat  -Wait
    # Print last 10 lines and wait for appended lines and print them
    cat  -Tail 10 -Wait
    

提交回复
热议问题