Linux
跳到导航
跳到搜索
工具
- [jq] 一个轻量级且灵活的命令行JSON处理器
Nginx
- Nginx灰度 cookie实现灰度
其他
- 终端不能输入中文
- 先
locale -a
查看,是否有zh_CN.utf8
- 如果没有,安装:
- centos: yum install glibc-common
- ubuntu: apt-get -y install language-pack-zh-hans
- 重新进入终端,检查环境变量, 如果还是不行,修改环境变量:
- LANG=zh_CN.UTF-8
- LC_ALL=LC_ALL=zh_CN.UTF-8
- 先
端口检测
- telnet
- 在telnet连接成功后,使用
Control +]
然后使用Control + D
退出它。 - 列出所有TCP连接套接字
telnet localhost 80
- lsof
- 监听ipv4进程
sudo lsof -n -i4TCP:5672 | grep LISTEN
- IPv6的程序:
sudo lsof -n -i6TCP:5672 | grep LISTEN
- ss
- 使用ss显示使用IPv4及其操作系统进程的侦听TCP套接字:
sudo ss --tcp -f inet --listening --numeric --processes
- 同样,对于使用IPv6的TCP套接字:
sudo ss --tcp -f inet6 --listening --numeric --processes
- netstat
sudo netstat --all --numeric --tcp --programs