get port status linux code example Example 1: find out which procses is using port linux sudo lsof -i:<port_number> Example 2: scan port linux netstat -plnt