課程
/云計(jì)算&大數(shù)據(jù)
/大數(shù)據(jù)
/Elastic Stack入門(mén)
window 系統(tǒng)可以使用什么命令替代,head
2017-12-01
源自:Elastic Stack入門(mén) 3-5
正在回答
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 # headgc -TotalCount 10 log.txt ? ? # also headgc log.txt | select -last 10 ?# tailgc -Tail 10 log.txt ? ? ? ? ? # also tail (since PSv3), also much faster than above optiongc log.txt | more ? ? ? ? ? ? # or less if you have it installedgc log.txt | %{ $_ -replace '\d+', '($0)' } ? ? ? ? # sed
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
sunyaox 提問(wèn)者
Get-Content nginx.log -TotalCount 2|./filebeat -e -c ngnix.yml
進(jìn)入到解壓的filebeat-6.0.0-windows-x86_64下,然后將nginx.yml拷貝到目錄下。
打開(kāi)dos窗口切換目錄到filebeat-6.0.0-windows-x86_64,執(zhí)行輸入命令? filebeat -e -c nginx.yml? 回車。
將nginx.log的兩條日志內(nèi)容,粘貼到啟動(dòng)的到dos窗口,就可以了。
然后呢
舉報(bào)
Elasticsearch、Logstash、Beats、Kibana基礎(chǔ)知識(shí)入門(mén)
1 回答關(guān)于啟動(dòng)集群信息顯示問(wèn)題
1 回答logstash監(jiān)聽(tīng)文件或定時(shí)啟動(dòng)問(wèn)題
5 回答packetbeat 無(wú)法啟動(dòng)
4 回答logstash啟動(dòng)報(bào)錯(cuò)
2 回答Windows下啟動(dòng)ElasticSearch報(bào)錯(cuò)
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2017-12-01
windows 下可以替代 head 的命令是 gc
https://stackoverflow.com/questions/9682024/how-to-do-what-head-tail-more-less-sed-do-in-powershell
2018-04-19
Get-Content nginx.log -TotalCount 2|./filebeat -e -c ngnix.yml
2017-12-01
進(jìn)入到解壓的filebeat-6.0.0-windows-x86_64下,然后將nginx.yml拷貝到目錄下。
打開(kāi)dos窗口切換目錄到filebeat-6.0.0-windows-x86_64,執(zhí)行輸入命令? filebeat -e -c nginx.yml? 回車。
將nginx.log的兩條日志內(nèi)容,粘貼到啟動(dòng)的到dos窗口,就可以了。
2017-12-01
然后呢