Windows equivalent of the 'tail' command

前端 未结 21 3054
长情又很酷
长情又很酷 2020-11-28 01:48

Is there a way to simulate the *nix tail command on the Windows command line? I have a file and I want a way to snip off the first n lines of text. For example:

21条回答
  •  孤街浪徒
    2020-11-28 02:29

    Get-content -Tail n file.txt with powershell is the only thing that comes close to tail in linux.

    The Get-Content *filename* | Select-Object -last *n* suggested above loads/parse the whole thing. Needless to say, it was not happy with my 10GB log file... The -Tail option does start by the end of the file.

提交回复
热议问题