linux常用网络命令

一. telnet (测试端口能否连接)

 telnet ip port

二.wget 下载文件(测试下载服务是否正常)

 wget url

三. curl 文件下载 /http请求

1.get请求

curl http://10.12.9.36:91/v2/project/mobile-wealth-home-page  只显示结果

curl -v  http://10.12.9.36:91/v2/project/mobile-wealth-home-page 显示get请求全过程‘

curl -I  http://10.12.9.36:91/v2/project/mobile-wealth-home-page 只显示响应头信息

curl -i  http://10.12.9.36:91/v2/project/mobile-wealth-home-page  显示响应头和结果

2.post请求

curl -d "userId=1000941"  http://10.12.9.36:91/v2/project/mobile-wealth-home-page

3.json格式的post请求(php不支持接收)

curl  -H  "Content-type: application/json" -X POST -d  '{"phone":"13521389587","password":"test"}'  http://domain/apis/users.json

四. netstat 打印网络系统的状态信息

-a或--all:显示所有连线中的Socket;
-c或--continuous:持续列出网络状态;
-h或--help:在线帮助;
-i或--interfaces:显示网络界面信息表单;
-l或--listening:显示监控中的服务器的Socket;
-n或--numeric:直接使用ip地址,而不通过域名服务器;
-p或--programs:显示正在使用Socket的程序识别码和程序名称;
-r或--route:显示Routing Table;
-t或--tcp:显示TCP传输协议的连线状况; -u或--udp:显示UDP传输协议的连线状况; -x或--unix:此参数的效果和指定"-A unix"参数相同;
原文地址:https://www.cnblogs.com/shijianchuzhenzhi/p/8484998.html