1.cd 命令
cd 进入用户主目录;
cd ~ 进入用户主目录;
cd - 返回进入此目录之前所在的目录;
cd .. 返回上级目录(若当前目录为“/“,则执行完后还在“/";".."为上级目录的意思);
cd ../.. 返回上两级目录;
cd / 进入系统根目录
2.locate 命令
locate luck.txt 精确查找文件的路径
locate -n 12 jdk -n 按个数查找的路径
3. tail/head
tail -f catalina.out
head -n 10 /etc/profile 显示/etc/profile的前10行内容
tail -n 5 /etc/profile 显示/etc/profile的最后5行内容
4.根据进程查询占用的端口
netstat -nap | grep 7189
netstat -nap | grep 7189
5. curl
GET请求
curl http://IP:Port/地址
curl http://IP:Port/地址
a.带上参数
curl http://IP:Port/地址?参数名='参数'
curl http://IP:Port/地址?参数名='参数'
Post请求
a.当个参数
curl -i -k -H "Content-type: application/json" -X POST -d '{"name":"abcddd"}' http://IP:Port/地址
a.当个参数
curl -i -k -H "Content-type: application/json" -X POST -d '{"name":"abcddd"}' http://IP:Port/地址
b.多个参数
curl -i -k -H "Content-type: application/json" -X POST -d '{"uuid":"xxxx","name":"张三","start":"0","end":"10"}' http://IP:Port/地址
curl -i -k -H "Content-type: application/json" -X POST -d '{"uuid":"xxxx","name":"张三","start":"0","end":"10"}' http://IP:Port/地址
c.包含数组
curl -i -k -H "Content-type: application/json" -X POST -d '{"idArrs": ["xxx1",'xxx2'],"userid": "xxxxx","pwd": "abcdefr111"}' http://IP:Port/地址
curl -i -k -H "Content-type: application/json" -X POST -d '{"idArrs": ["xxx1",'xxx2'],"userid": "xxxxx","pwd": "abcdefr111"}' http://IP:Port/地址
d.接口时间get
curl -o /dev/null -s -w "time_connect: %{time_connect} time_starttransfer: %{time_starttransfer} time_total: %{time_total} " "http://IP:Port/地址"
curl -o /dev/null -s -w "time_connect: %{time_connect} time_starttransfer: %{time_starttransfer} time_total: %{time_total} " "http://IP:Port/地址"