Port used by example 2



$ nc -l localhost 10000 > log.txt
$ telnet localhost 10000
$ sudo lsof -i :10000

$ sudo cat /proc/PID/cmdline