sunyaox
2017-12-01 15:49
window 系统可以使用什么命令替代,head
windows 下可以替代 head 的命令是 gc
https://stackoverflow.com/questions/9682024/how-to-do-what-head-tail-more-less-sed-do-in-powershell
gc log.txt | select -first 10 # head
gc -TotalCount 10 log.txt # also head
gc log.txt | select -last 10 # tail
gc -Tail 10 log.txt # also tail (since PSv3), also much faster than above option
gc log.txt | more # or less if you have it installed
gc log.txt | %{ $_ -replace '\d+', '($0)' } # sed
Get-Content nginx.log -TotalCount 2|./filebeat -e -c ngnix.yml
进入到解压的filebeat-6.0.0-windows-x86_64下,然后将nginx.yml拷贝到目录下。
打开dos窗口切换目录到filebeat-6.0.0-windows-x86_64,执行输入命令 filebeat -e -c nginx.yml 回车。
将nginx.log的两条日志内容,粘贴到启动的到dos窗口,就可以了。
然后呢
Elastic Stack入门
32742 学习 · 76 问题
相似问题