때때로 기본 HTML을 콘솔에 출력하는 간단한 작업을 수행해야합니다. 한 눈에 쉽게 읽을 수 있도록 최소한으로 렌더링하고 싶습니다. 쉘에서 기본 HTML 렌더링을 처리 할 수있는 유틸리티가 있습니까 ( Lynx 스타일 렌더링 은 생각 하지만 실제 브라우저는 아님)?
예를 들어, 때로는 watch
Apache의 mod_status
페이지에 다음을 추가합니다.
watch -n 1 curl http://some-server/server-status
페이지의 출력은 약간의 마크 업이있는 HTML이며 셸에 다음과 같이 표시됩니다.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html><head>
<title>Apache Status</title>
</head><body>
<h1>Apache Server Status for localhost</h1>
<dl><dt>Server Version: Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.15 with Suhosin-Patch</dt>
<dt>Server Built: Jul 22 2014 14:35:25
</dt></dl><hr /><dl>
<dt>Current Time: Wednesday, 19-Nov-2014 15:21:40 UTC</dt>
<dt>Restart Time: Wednesday, 19-Nov-2014 15:13:02 UTC</dt>
<dt>Parent Server Generation: 1</dt>
<dt>Server uptime: 8 minutes 38 seconds</dt>
<dt>Total accesses: 549 - Total Traffic: 2.8 MB</dt>
<dt>CPU Usage: u35.77 s12.76 cu0 cs0 - 9.37% CPU load</dt>
<dt>1.06 requests/sec - 5.6 kB/second - 5.3 kB/request</dt>
<dt>1 requests currently being processed, 9 idle workers</dt>
</dl><pre>__W._______.....................................................
................................................................
................................................................
................................................................
</pre>
<p>Scoreboard Key:<br />
"<b><code>_</code></b>" Waiting for Connection,
"<b><code>S</code></b>" Starting up,
"<b><code>R</code></b>" Reading Request,<br />
"<b><code>W</code></b>" Sending Reply,
"<b><code>K</code></b>" Keepalive (read),
"<b><code>D</code></b>" DNS Lookup,<br />
"<b><code>C</code></b>" Closing connection,
"<b><code>L</code></b>" Logging,
"<b><code>G</code></b>" Gracefully finishing,<br />
"<b><code>I</code></b>" Idle cleanup of worker,
"<b><code>.</code></b>" Open slot with no current process</p>
<p />
Lynx에서 볼 때 동일한 HTML이 다음과 같이 렌더링됩니다. Apache 상태 (p1 / 2) localhost에 대한 Apache 서버 상태
Server Version: Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.15 with Suhosin-Patch
Server Built: Jul 22 2014 14:35:25
________________________________________________________________________________________________________
Current Time: Wednesday, 19-Nov-2014 15:23:50 UTC
Restart Time: Wednesday, 19-Nov-2014 15:13:02 UTC
Parent Server Generation: 1
Server uptime: 10 minutes 48 seconds
Total accesses: 606 - Total Traffic: 3.1 MB
CPU Usage: u37.48 s13.6 cu0 cs0 - 7.88% CPU load
.935 requests/sec - 5088 B/second - 5.3 kB/request
2 requests currently being processed, 9 idle workers
_C_______W_.....................................................
................................................................
................................................................
................................................................
Scoreboard Key:
"_" Waiting for Connection, "S" Starting up, "R" Reading Request,
"W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup,
"C" Closing connection, "L" Logging, "G" Gracefully finishing,
"I" Idle cleanup of worker, "." Open slot with no current process
xiki는 굉장해 보인다.
—
MountainX
bash
정확히하지만, 체크 아웃 Xiki을 , 그보다 않습니다