实战命令行
# 前言
本文是记录在开发中遇到的一些小经验,持续更新。
# 后台执行命令
# app为程序
nohup ./app 2>&1 &
1
2
2
# curl
的使用
# curl
基础请求
curl https://xingcxb.com
1
# curl
代理 http
请求
# 方式一
# 不带密码
curl -x "http://127.0.0.1:1234" "https://xingcxb.com"
# 带密码
curl -x "http://user:pwd@127.0.0.1:1234" "https://xingcxb.com"
# 方式二
curl --proxy "http://127.0.0.1:1234" "https://xingcxb.com"
curl --proxy "http://user:pwd@127.0.0.1:1234" "https://xingcxb.com"
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
# curl
代理 socks5
请求
# 方式一
# 不带密码
curl --socks5-hostname 127.0.0.1:56789 https://xingcxb.com
# 带密码
curl --socks5-hostname 127.0.0.1:56789 -U user:pwd https://xingcxb.com
# 方式二
curl -x socks5h://127.0.0.1:56789 https://xingcxb.com
curl -x socks5h://user:pwd@127.0.0.1:56789 https://xingcxb.com
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
# wget
的使用
# wget
基础请求
wget https://xingcxb.com/abc/123.txt
1
# wget
代理 http
请求
# 不带用户名和密码
wget -e https_proxy=127.0.0.1:56789 https://xingcxb.com/abc/123.txt
# 带用户名和密码
wget --user=username --password=password -e https_proxy=127.0.0.1:56789 "https://xingcxb.com/abc/123.txt"
1
2
3
4
2
3
4
# 查看端口命令
netstat -nultp
查看所有端口netstat -anp |grep 82
查看82端口
# 分割文件命令
假设文件位置为
/home/biglog.log
# 分割成100M的文件
split -b 100m /home/biglog.log
1
2
2
更新时间: 2023/11/22 14:48:39