使用命令行工具,我需要提取文本「HTTP」,(或任何協議恰好是),關鍵字「檢測的協議」之後:如何在Linux中提取文件的特定行和列?
部分文件內容:
Detected protocol:
HTTP 1254
完整的文件內容:
nDPI Memory statistics:
nDPI Memory (once): 103.29 KB
Flow Memory (per flow): 1.91 KB
Actual Memory: 1.76 MB
Peak Memory: 1.76 MB
Traffic statistics:
Ethernet bytes: 1342 (includes ethernet CRC/IFC/trailer)
Discarded bytes: 0
IP packets: 10 of 10 packets total
IP bytes: 1102 (avg pkt size 110 bytes)
Detected protocols:
HTTP packets: 10 bytes: 1102 flows: 1
Protocol statistics:
Acceptable 1102 bytes
我會建議使用多行sed' - 見[這裏](http://superuser.com/a/634848/438726),或者如果你需要更多的控制,'awk'。 – urban
您剛剛給出的此示例輸入的預期輸出是什麼?嘗試閱讀[問]在這裏有更好的體驗。 – fedorqui