2022 01 24 I01 How to Check Used Ports on Linux

Mon, Jan 24, 2022 One-minute read

To check on which ports the Linux server is listening, run the below command:

netstat -tulpn | grep LISTEN

Example output:

[[email protected] ~]$ netstat -tulpn | grep LISTEN
    (Not all processes could be identified, non-owned process info
    will not be shown, you would have to be root to see it all.)
    tcp        0      0 0.0.0.0:5355            0.0.0.0:*               LISTEN      -                   
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -                   
    tcp6       0      0 :::5355                 :::*                    LISTEN      -                   
    tcp6       0      0 :::8080                 :::*                    LISTEN      -                   
    tcp6       0      0 :::8084                 :::*                    LISTEN      -                   
    tcp6       0      0 :::22                   :::*                    LISTEN      -                   
    tcp6       0      0 :::4118                 :::*                    LISTEN      -

Useful resources: