Linux如何顯示文件指定行數的內容

[size=small] 1. grep命令,比sed命令好用 [url]http://www.cnblogs.com/end/archive/2012/02/21/2360965.html[/url] grep -n -C 100 "hello" a.log > searchResult.txt 上面命令實現了多個功能: 1)查找文件a.log中包含的關鍵詞hello的內容 2)結果中顯示行號
相關文章
相關標籤/搜索