开发者

Powershell: how to stream, paginate text from very large files?

开发者 https://www.devze.com 2023-03-30 15:19 出处:网络
I\'ve got some huge log files that I need to view. I don\'t want to attempt to open them up in an editor, and I\'d like to be able to scroll through them in a paginated manner. It seems as if there is

I've got some huge log files that I need to view. I don't want to attempt to open them up in an editor, and I'd like to be able to scroll through them in a paginated manner. It seems as if there is an alias for more in powershell but piping to it doesn't do anything and get-help yields only "more."

This see开发者_StackOverflow中文版ms to me like a totally silly question, but I haven't figured it out yet--how can I get something similar to the unix more command?


Try the Out-Host cmdlet:

Get-Content file.txt | Out-Host -Paging


This is one way:

get-content file | out-host -Paging
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号