Unix tail equivalent command in Windows Powershell

后端 未结 13 1566
攒了一身酷
攒了一身酷 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:58

    For completeness I'll mention that Powershell 3.0 now has a -Tail flag on Get-Content

    Get-Content ./log.log -Tail 10
    

    gets the last 10 lines of the file

    Get-Content ./log.log -Wait -Tail 10
    

    gets the last 10 lines of the file and waits for more

    Also, for those *nix users, note that most systems alias cat to Get-Content, so this usually works

    cat ./log.log -Tail 10
    
    0 讨论(0)
提交回复
热议问题