常用命令

清空屏幕

1
clear

端口占用

1
lsof -i:端口号
1
netstat -tunlp |grep 端口号

后台运行jar包

1
nohup java -jar xxx.jar &

nginx

启动

1
/usr/local/nginx/sbin/nginx
1
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

重新加载配置

1
2
3
4
#进入nginx目录
cd /usr/local/nginx/sbin
#执行重载命令
./nginx -s reload

关闭

1
2
3
4
5
6
#进入nginx目录
cd /usr/local/nginx/sbin
# 快速停止nginx
./nginx -s stop
# 完整有序的停止nginx,这个命令会等待所有请求结束后再关闭nginx
./nginx -s quit

防火墙

启动

1
systemctl start firewalld

关闭

1
systemctl stop firewalld

查看状态

1
systemctl status firewalld

开机禁用

1
systemctl disable firewalld

开机启用

1
systemctl enable firewalld