DEV.KAOLLOVE.JP ~日々の技術的なメモ~

2019/09/27

telnetコマンドの代わりはcurlで

最近のLinux環境だと、最初からtelnetコマンドが入っておらず、ネットワークの疎通試験をしたいときに不便。そういうときはcurlコマンドで代用できる。
$ curl -v telnet://www.google.com:80
* About to connect() to www.google.com port 80 (#0)
*   Trying 216.58.199.228... connected
* Connected to www.google.com (216.58.199.228) port 80 (#0)
GET / HTTP/1.0
 
HTTP/1.0 302 Found
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Referrer-Policy: no-referrer
Location: http://www.google.co.jp/?gfe_rd=cr&dcr=0&ei=4nrKWduvHfSQ8QeIjZGgAg
Content-Length: 271
Date: Tue, 26 Sep 2017 16:05:54 GMT
(以下略)

shellの色がキレイにつかないな...