系统相关
首页 > 系统相关> > linux-centos操作-防火墙-ip-查看进程

linux-centos操作-防火墙-ip-查看进程

作者:互联网

防火墙
1 查看防火墙状态
    firewall-cmd    --state
2 关闭防火墙
    systemctl stop firewalld.service
3 开启防火墙
    systemctl start filewalld.service
4 禁止开机启动防火墙
    systemctl disable filewalld.service

1将8080端口添加到防火墙例外并重启

firewall-cmd --zone=public --add-port=8080/tcp --permanent

firewall-cmd --reload

 

查看ip

ip addr

切换root

su root

 

1.根据进程名查看进程信息,以查看tomcat进程名为例,查看所对应的进程id为1095(或者使用: ps -aux | grep tomcat 查看占用内存等信息)
ps -ef | grep tomcat

2.根据进程id查看进程占用端口,查看对应端口为8080(如果没有netstat命令,使用 yum  -y  install  net-tools安装)
netstat -nap | grep 1095

3.根据端口查看对应进程,查看占用8080端口的进程id,为1095
netstat -tunlp | grep 8080

4.根据进程id查看进程信息,查看进程id为1095的进程信息
ps -ef | grep 1095

5.根据进程id杀死进程,杀死进程id为1095的进程
kill -9 1095

标签:1095,grep,centos,查看,ip,防火墙,linux,进程,id
来源: https://blog.csdn.net/weixin_44369955/article/details/116231520