Bash/Port
Jump to navigation
Jump to search
Using fuser
# check 22210 port is running
fuser 22210/tcp
# 22210/tcp: 4981
# check 55510 port is running
fuser 55510/tcp
# 55510/tcp: 5062
Using lsof
# check 22210 port is running
lsof -i TCP:22210
# COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
# java 4981 chorke 280u IPv6 37810 0t0 TCP *:22210 (LISTEN)
# check 55510 port is running
lsof -i TCP:55510
# COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
# java 5062 chorke 280u IPv6 37810 0t0 TCP *:55510 (LISTEN)
Using netstat
# check 22210 port is running
netstat -punta | grep 22210
# tcp6 0 0 :::22210 :::* LISTEN 4981/java
# check 55510 port is running
netstat -punta | grep 55510
# tcp6 0 0 :::55510 :::* LISTEN 5062/java
Specific Port Enable
firewall-cmd --zone=public --permanent --add-port=11100/tcp
firewall-cmd --zone=public --permanent --add-port=1521/tcp
firewall-cmd --zone=public --permanent --add-port=3306/tcp
firewall-cmd --zone=public --permanent --add-port=5432/tcp
firewall-cmd --reload
netstat
Range of Port Enable
firewall-cmd --zone=public --permanent --add-port=22200-22290/tcp
firewall-cmd --zone=public --permanent --add-port=55500-55590/tcp
firewall-cmd --zone=public --permanent --add-port=11110-11119/tcp
firewall-cmd --reload
netstat