shell 如何打印出匹配内容的下一列

列如下面在匹配了Freememory:字段后打印出后面的值。<h1>JVM</h1><\n>Freememory:176.19MBTotalmemory:240.87MB... 列如下面在匹配了 Free memory: 字段后打印出后面的值。
<h1>JVM</h1><\n> Free memory: 176.19 MB Total memory: 240.87 MB Max memory: 3575.12 MB</p><table border="0"><thead><tr><th>Memory Pool</th><th>Type</th><th>Initial</th><th>Total</th><th>Maximum</th><th>Used</th></tr></thead><tbody><tr><td>PS Eden Space</td><td>Heap memory</td><td>62.87 MB</td><td>62.87 MB</td><td>1319.75 MB</td><td>52.82 MB (4%)</td></tr><tr><td>PS Old Gen</td><td>Heap memory</td><td>167.56 MB</td><td>167.56 MB</td><td>2681.37 MB</td><td>1.41 MB (0%)</td></tr><tr><td>PS Survivor Space</td><td>Heap memory</td><td>10.43 MB</td><td>10.43 MB</td><td>10.43 MB</td><td>10.43 MB (99%)</td></tr><tr><td>Code Cache</td><td>Non-heap memory</td><td>2.43 MB</td><td>2.43 MB</td><td>48.00 MB</td><td>1.19 MB (2%)</td></tr><tr><td>PS Perm Gen</td><td>Non-heap memory</td><td>20.75 MB</td><td>20.75 MB</td><td>82.00 MB</td><td>17.09 MB (20%)</td></tr></tbody></table><h1>"ajp-bio-8009"</h1><p> Max threads: 200 Current thread count: 0 Current thread busy: 0<br> Max processing time: 0 ms Processing time: 0.0 s Request count:
0 Error count: 0 Bytes received: 0.00 MB Bytes sent: 0.00 MB</p><table border="0"><tr><th>Stage</th><th>Time</th><th>B Sent</th><th>B Recv</th><th>Client (Forwarded)</th><th>Client (Actual)</th><th>VHost</th><th>Request</th></tr></table><p>P: Parse and prepare request S: Service F: Finishing R: Ready K: Keepalive</p><h1>"http-bio-8080"</h1><p> Max threads: 200 Current thread count: 10 Current thread busy: 1<br> Max processing time: 3624 ms Processing time: 6.111 s Request count: 68 Error count: 22 Bytes received: 0.00 MB Bytes sent: 0.34 MB</p><table border="0"><tr><th>Stage</th><th>Time</th><th>B Sent</th><th>B Recv</th><th>Client (Forwarded)</th><th>Client (Actual)</th><th>VHost</th><th>Request</th></tr><tr><td><strong>R</strong></td><td>?</td><td>?</td><td>?</td><td>?</td><td>?</td><td>?</td></tr><tr><td><strong>S</strong></td><td>14 ms</td><td>0 KB</td><td>0 KB</td><td>172.20.200.36</td><td>172.20.200.36</td><td nowrap>172.20.200.10</td><td nowrap class="row-left">GET /manager/status HTTP/1.1</td></tr><tr><td><strong>R</strong></td><td>?</td><td>?</td><td>?</td><td>?</td><td>?</td><td>?</td></tr></table><p>P: Parse and prepare request S: Service F: Finishing R: Ready K: Keepalive</p><hr size="1" noshade="noshade">
<center><font size="-1" color="#525D76">
<em>Copyright © 1999-2016, Apache Software Foundation</em></font></center>
展开
 我来答
qmg1023
2016-06-17 · TA获得超过888个赞
知道小有建树答主
回答量:804
采纳率:0%
帮助的人:907万
展开全部
内容在1.txt,脚本为:

grep Free 1.txt | sed 's/.*\(Free[^<]*\).*/\1/'
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式