Linux - How to find which process is listening upon a port, Find process using a port
How to find which process is listening upon a port
fuser is an useful tool used to find open ports and all to kill or stop program using a filesystem or directory.# fuser -km /homekills all processes accessing the filesystem or directory /home
show all processes at (local) TELNET port
# fuser -s /dev/tty # fuser telnet/tcp
# netstat --tcp --udp --listening --program
# fuser -n | grep | awk '{print $2}' # ps -ef | grep | awk '{print $4}'
Get the PID of the process listening on a known port
# fuser -n [tcp | udp] [portno.] | grep [tcp | udp] | awk '{print $2}' # ps -e | grep [pid] | awk '{print $4}' # fuser -n | grep | awk '{print $2}' # ps -e | grep | awk '{print $4}'
Find open port and program running on it
netstat -antlp | grep tcp | grep LIST | awk '{print $4,$7}' | awk -F: '{print $2}' | awk -F/ '{print $1,$2}' | awk '{print $1,$3}' | sort -nu
Other commands which are normally used is
# netstat -antulp # rpcinfo -p host # netstat -plan | grep $(pgrep process_name)Above method can be used to monitor or find out the open port of a specific program. For example if you are using jboss and the process which you want findout can be jboss or your browser name.
The topic on Linux - How to find which process is listening upon a port is posted by - Math
Hope you have enjoyed, Linux - How to find which process is listening upon a portThanks for your time