centos7配置常用命令

安装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 #停止firewall

systemctl 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

启动tomcat
systemctl start tomcat
停止tomcat
systemctl stop tomcat
重启tomcat
systemctl restart tomcat

因为配置pid,在启动的时候会再



systemctl reboot	重启机器
systemctl poweroff	关机
systemctl suspend	待机
systemctl hibernate	休眠

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值