Equivalent of 'more' or 'less' command in Powershell?

后端 未结 12 2036
小蘑菇
小蘑菇 2020-12-13 01:38

Is there a way to paginate the output by piping it to some \'more\' command, which is available in linux\\unix shells?

12条回答
  •  失恋的感觉
    2020-12-13 01:57

    cat C:\Temp\test.txt
    

    cat is an alias for Get-Content - with larger files you will get the -- More -- output at the bottom of the terminal

    You can also you can add -wait

    cat C:\Temp\test.txt -wait 
    

    -wait is like using tail but it actually is rerunning the command just refreshing the output

    cat C:\Temp\test.txt | oh –Paging
    

    oh = Out-Host

提交回复
热议问题