Linux日誌查詢理解(不再死記命令)

grep的全稱:global search regular and print out the line 雷同與windows環境的ctrl+F

查看日誌:cat test.log

-n 展示行數

cat 從頭到尾讀
head 從頭部讀
tail 從尾部讀

理解以上命令就可以實戰查詢日誌了

grep -n “目標日誌” test.log

cat test.log | head -n +100 | head -n 20

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章