Unix tail equivalent command in Windows Powershell

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

    I used some of the answers given here but just a heads up that

    Get-Content -Path Yourfile.log -Tail 30 -Wait 
    

    will chew up memory after awhile. A colleague left such a "tail" up over the last day and it went up to 800 MB. I don't know if Unix tail behaves the same way (but I doubt it). So it's fine to use for short term applications, but be careful with it.

提交回复
热议问题