centos7配置常用命令

来源:互联网 发布:php 字符集转换 编辑:程序博客网 时间:2024/05/16 11:58
安装netstat插件 yum install net-tools安装killall插件 yum install psmisc查看ip: ip addr 192.168.1.111查看所有端口  netstat -ano ( netstat -tunlp)开启端口  firewall-cmd --zone=public --add-port=80/tcp --permanent  命令含义:  --zone #作用域  --add-port=80/tcp #添加端口,格式为:端口/通讯协议  --permanent #永久生效,没有此参数重启后失效 重启防火墙  firewall-cmd --reload 查看端口firewall-cmd --zone=public --query-port=80/tcp --permanent 关闭firewall:systemctl stop firewalld.service #停止firewallsystemctl disable firewalld.service #禁止firewall开机启动firewalld启动:# systemctl start firewalld查看状态:# systemctl status firewalld或者firewall-cmd --state禁用:# systemctl stop firewalld查看全部服务命令:systemctl list-unit-files --type service查看服务systemctl status name.service启动服务systemctl start name.service停止服务systemctl stop name.service重启服务systemctl restart name.service增加开机启动systemctl enable name.service删除开机启动systemctl disable name.service其中.service 可以省略。配置开机启动 systemctl enable tomcat启动tomcatsystemctl start tomcat停止tomcatsystemctl stop tomcat重启tomcatsystemctl restart tomcat因为配置pid,在启动的时候会再systemctl reboot重启机器systemctl poweroff关机systemctl suspend待机systemctl hibernate休眠
0 0
原创粉丝点击