linux 常用命令

centos7

防火墙开启自启:systemctl enable firewalld

防火墙关闭自启:systemctl disable firewalld

关闭防火墙:systemctl stop firewalld.service

开启防火墙:systemctl start firewalld.service

重启防火墙:systemctl restart firewalld.service

防火墙状态:systemctl status firewalld.service

查看端口:firewall-cmd --zone=public --list-ports

开启端口:firewall-cmd --zone=public --add-port=80/tcp --permanent

查看端口占用:netstat -anp | grep 8087

启动apache:systemctl start httpd

原文地址:https://www.cnblogs.com/shuzhixia/p/15711798.html