How can I check which ports are busy and which ports are free on my Linux machine?












27















Is there any command line command or any other way to find and list out the busy and free port numbers on my Linux machine?










share|improve this question





























    27















    Is there any command line command or any other way to find and list out the busy and free port numbers on my Linux machine?










    share|improve this question



























      27












      27








      27


      11






      Is there any command line command or any other way to find and list out the busy and free port numbers on my Linux machine?










      share|improve this question
















      Is there any command line command or any other way to find and list out the busy and free port numbers on my Linux machine?







      linux command-line fedora port






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 23 '11 at 13:25









      jonsca

      3,030112641




      3,030112641










      asked Dec 23 '11 at 12:49









      Jeegar PatelJeegar Patel

      2932611




      2932611






















          4 Answers
          4






          active

          oldest

          votes


















          41














          The command



          netstat -antu


          will show all tcp and udp ports in use. The output will look something like this:



          Proto Recv-Q Send-Q Local Address           Foreign Address         State
          tcp 0 0 0.0.0.0:59753 0.0.0.0:* LISTEN


          The number after the colon in the Local Address field shows the port in use. If the state is "LISTEN" it means a port that is using for incoming connections. If the IP address in the Local Address field is 0.0.0.0 it means incoming connections will be accepted on any IP address assigned to an interface - so this means from connections originating outside of your machine.



          If it said localhost or 127.0.0.1 it would be only accepting connections from your machine.



          Additionally, if you add the -p parameter, and run it as root, it will show the process that opened the port:



          $ sudo netstat -antup
          Active Internet connections (servers and established)
          Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
          tcp 0 0 0.0.0.0:59753 0.0.0.0:* LISTEN 860/rpc.statd


          Anything not shown as being in use is free, however users (unprivileged accounts) can only open ports above 1023.






          share|improve this answer
























          • it means incoming connections will be accepted on any IP address assigned to an interface - so this means from connections originating outside of your machine didn't you make an error here? You probably meant, that connections will be accepted, if they come on any address assigned to a given interface, regardless of their origin. The origin of incoming connections is probably specified in the next column Foreign Address. So it's there, if one has 0.0.0.0 as a value, it means that the connections will be accepted from anywhere, including outside of the machine

            – user907860
            Oct 5 '17 at 12:28






          • 1





            @user907860 It might not be clear, but the distinction I am making is between 0.0.0.0 vs 127.0.0.1 - the latter will only accept connections from your machine, because it is listening on an unrouted IP address. Where as 0.0.0.0 means any address on your machine, and so provided they are routed, connections can be made from other machines.

            – Paul
            Oct 5 '17 at 22:22











          • Just FYI, -antu can be written as -tuna 🐟

            – Abdennour TOUMI
            Nov 10 '18 at 20:38



















          12














          I compiled a small list myself.



          Some of my favorites are:



          netstat -tulpn
          lsof -i -n -P





          share|improve this answer

































            7














            A good and reliable way to check for ports opened is using ss (replacement for the deprecated netstat), it's usable in a script without requiring elevated privileges (i.e. sudo).



            Usage: option -l for listening ports, option -n to bypass DNS resolution, and the filter on source port NN: src :NN (replace NN by the port you want to monitor). For more options, see man ss



            ss -ln src :NN


            Examples:



            [user@server ~]# ss -ln src :80
            State Recv-Q Send-Q Local Address:Port Peer Address:Port
            LISTEN 0 128 *:80 *:*
            [user@server ~]# ss -ln src :81
            State Recv-Q Send-Q Local Address:Port Peer Address:Port


            And in a script, using grep, we can test if the output contains the port we requested.
            Example with port 80 in use (see above):



            myport=80
            # count the number of occurrences of port $myport in output: 1= in use; 0 = not in use
            result=$(ss -ln src :$myport | grep -Ec -e "<$myport>")
            if [ "$result" -eq 1 ]; then
            echo "Port $myport is in use (result == $result) "
            else
            echo "Port $myport is NOT in use (result == $result) "
            fi

            # output:
            Port 80 is in use (result == 1)


            Example with port 81 not in use (see above)



            myport=81
            result=$(ss -ln src :$myport | grep -Ec -e "<$myport>")
            if [ "$result" -eq 1 ]; then
            echo "Port $myport is in use (result == $result) "
            else
            echo "Port $myport is NOT in use (result == $result) "
            fi

            # output:
            Port 81 is NOT in use (result == 0)





            share|improve this answer































              3














              Another way:



              telnet localhost <PORT_NUMBER>


              If the port is free you will get an error. If the port is in use telnet will connect.



              (found on http://www.unix.com/unix-for-dummies-questions-and-answers/8456-how-know-whether-particular-port-number-free-not.html)






              share|improve this answer
























                Your Answer








                StackExchange.ready(function() {
                var channelOptions = {
                tags: "".split(" "),
                id: "3"
                };
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function() {
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled) {
                StackExchange.using("snippets", function() {
                createEditor();
                });
                }
                else {
                createEditor();
                }
                });

                function createEditor() {
                StackExchange.prepareEditor({
                heartbeatType: 'answer',
                autoActivateHeartbeat: false,
                convertImagesToLinks: true,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: 10,
                bindNavPrevention: true,
                postfix: "",
                imageUploader: {
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                },
                onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                });


                }
                });














                draft saved

                draft discarded


















                StackExchange.ready(
                function () {
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f370965%2fhow-can-i-check-which-ports-are-busy-and-which-ports-are-free-on-my-linux-machin%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                4 Answers
                4






                active

                oldest

                votes








                4 Answers
                4






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                41














                The command



                netstat -antu


                will show all tcp and udp ports in use. The output will look something like this:



                Proto Recv-Q Send-Q Local Address           Foreign Address         State
                tcp 0 0 0.0.0.0:59753 0.0.0.0:* LISTEN


                The number after the colon in the Local Address field shows the port in use. If the state is "LISTEN" it means a port that is using for incoming connections. If the IP address in the Local Address field is 0.0.0.0 it means incoming connections will be accepted on any IP address assigned to an interface - so this means from connections originating outside of your machine.



                If it said localhost or 127.0.0.1 it would be only accepting connections from your machine.



                Additionally, if you add the -p parameter, and run it as root, it will show the process that opened the port:



                $ sudo netstat -antup
                Active Internet connections (servers and established)
                Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
                tcp 0 0 0.0.0.0:59753 0.0.0.0:* LISTEN 860/rpc.statd


                Anything not shown as being in use is free, however users (unprivileged accounts) can only open ports above 1023.






                share|improve this answer
























                • it means incoming connections will be accepted on any IP address assigned to an interface - so this means from connections originating outside of your machine didn't you make an error here? You probably meant, that connections will be accepted, if they come on any address assigned to a given interface, regardless of their origin. The origin of incoming connections is probably specified in the next column Foreign Address. So it's there, if one has 0.0.0.0 as a value, it means that the connections will be accepted from anywhere, including outside of the machine

                  – user907860
                  Oct 5 '17 at 12:28






                • 1





                  @user907860 It might not be clear, but the distinction I am making is between 0.0.0.0 vs 127.0.0.1 - the latter will only accept connections from your machine, because it is listening on an unrouted IP address. Where as 0.0.0.0 means any address on your machine, and so provided they are routed, connections can be made from other machines.

                  – Paul
                  Oct 5 '17 at 22:22











                • Just FYI, -antu can be written as -tuna 🐟

                  – Abdennour TOUMI
                  Nov 10 '18 at 20:38
















                41














                The command



                netstat -antu


                will show all tcp and udp ports in use. The output will look something like this:



                Proto Recv-Q Send-Q Local Address           Foreign Address         State
                tcp 0 0 0.0.0.0:59753 0.0.0.0:* LISTEN


                The number after the colon in the Local Address field shows the port in use. If the state is "LISTEN" it means a port that is using for incoming connections. If the IP address in the Local Address field is 0.0.0.0 it means incoming connections will be accepted on any IP address assigned to an interface - so this means from connections originating outside of your machine.



                If it said localhost or 127.0.0.1 it would be only accepting connections from your machine.



                Additionally, if you add the -p parameter, and run it as root, it will show the process that opened the port:



                $ sudo netstat -antup
                Active Internet connections (servers and established)
                Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
                tcp 0 0 0.0.0.0:59753 0.0.0.0:* LISTEN 860/rpc.statd


                Anything not shown as being in use is free, however users (unprivileged accounts) can only open ports above 1023.






                share|improve this answer
























                • it means incoming connections will be accepted on any IP address assigned to an interface - so this means from connections originating outside of your machine didn't you make an error here? You probably meant, that connections will be accepted, if they come on any address assigned to a given interface, regardless of their origin. The origin of incoming connections is probably specified in the next column Foreign Address. So it's there, if one has 0.0.0.0 as a value, it means that the connections will be accepted from anywhere, including outside of the machine

                  – user907860
                  Oct 5 '17 at 12:28






                • 1





                  @user907860 It might not be clear, but the distinction I am making is between 0.0.0.0 vs 127.0.0.1 - the latter will only accept connections from your machine, because it is listening on an unrouted IP address. Where as 0.0.0.0 means any address on your machine, and so provided they are routed, connections can be made from other machines.

                  – Paul
                  Oct 5 '17 at 22:22











                • Just FYI, -antu can be written as -tuna 🐟

                  – Abdennour TOUMI
                  Nov 10 '18 at 20:38














                41












                41








                41







                The command



                netstat -antu


                will show all tcp and udp ports in use. The output will look something like this:



                Proto Recv-Q Send-Q Local Address           Foreign Address         State
                tcp 0 0 0.0.0.0:59753 0.0.0.0:* LISTEN


                The number after the colon in the Local Address field shows the port in use. If the state is "LISTEN" it means a port that is using for incoming connections. If the IP address in the Local Address field is 0.0.0.0 it means incoming connections will be accepted on any IP address assigned to an interface - so this means from connections originating outside of your machine.



                If it said localhost or 127.0.0.1 it would be only accepting connections from your machine.



                Additionally, if you add the -p parameter, and run it as root, it will show the process that opened the port:



                $ sudo netstat -antup
                Active Internet connections (servers and established)
                Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
                tcp 0 0 0.0.0.0:59753 0.0.0.0:* LISTEN 860/rpc.statd


                Anything not shown as being in use is free, however users (unprivileged accounts) can only open ports above 1023.






                share|improve this answer













                The command



                netstat -antu


                will show all tcp and udp ports in use. The output will look something like this:



                Proto Recv-Q Send-Q Local Address           Foreign Address         State
                tcp 0 0 0.0.0.0:59753 0.0.0.0:* LISTEN


                The number after the colon in the Local Address field shows the port in use. If the state is "LISTEN" it means a port that is using for incoming connections. If the IP address in the Local Address field is 0.0.0.0 it means incoming connections will be accepted on any IP address assigned to an interface - so this means from connections originating outside of your machine.



                If it said localhost or 127.0.0.1 it would be only accepting connections from your machine.



                Additionally, if you add the -p parameter, and run it as root, it will show the process that opened the port:



                $ sudo netstat -antup
                Active Internet connections (servers and established)
                Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
                tcp 0 0 0.0.0.0:59753 0.0.0.0:* LISTEN 860/rpc.statd


                Anything not shown as being in use is free, however users (unprivileged accounts) can only open ports above 1023.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 23 '11 at 13:11









                PaulPaul

                48.6k14122149




                48.6k14122149













                • it means incoming connections will be accepted on any IP address assigned to an interface - so this means from connections originating outside of your machine didn't you make an error here? You probably meant, that connections will be accepted, if they come on any address assigned to a given interface, regardless of their origin. The origin of incoming connections is probably specified in the next column Foreign Address. So it's there, if one has 0.0.0.0 as a value, it means that the connections will be accepted from anywhere, including outside of the machine

                  – user907860
                  Oct 5 '17 at 12:28






                • 1





                  @user907860 It might not be clear, but the distinction I am making is between 0.0.0.0 vs 127.0.0.1 - the latter will only accept connections from your machine, because it is listening on an unrouted IP address. Where as 0.0.0.0 means any address on your machine, and so provided they are routed, connections can be made from other machines.

                  – Paul
                  Oct 5 '17 at 22:22











                • Just FYI, -antu can be written as -tuna 🐟

                  – Abdennour TOUMI
                  Nov 10 '18 at 20:38



















                • it means incoming connections will be accepted on any IP address assigned to an interface - so this means from connections originating outside of your machine didn't you make an error here? You probably meant, that connections will be accepted, if they come on any address assigned to a given interface, regardless of their origin. The origin of incoming connections is probably specified in the next column Foreign Address. So it's there, if one has 0.0.0.0 as a value, it means that the connections will be accepted from anywhere, including outside of the machine

                  – user907860
                  Oct 5 '17 at 12:28






                • 1





                  @user907860 It might not be clear, but the distinction I am making is between 0.0.0.0 vs 127.0.0.1 - the latter will only accept connections from your machine, because it is listening on an unrouted IP address. Where as 0.0.0.0 means any address on your machine, and so provided they are routed, connections can be made from other machines.

                  – Paul
                  Oct 5 '17 at 22:22











                • Just FYI, -antu can be written as -tuna 🐟

                  – Abdennour TOUMI
                  Nov 10 '18 at 20:38

















                it means incoming connections will be accepted on any IP address assigned to an interface - so this means from connections originating outside of your machine didn't you make an error here? You probably meant, that connections will be accepted, if they come on any address assigned to a given interface, regardless of their origin. The origin of incoming connections is probably specified in the next column Foreign Address. So it's there, if one has 0.0.0.0 as a value, it means that the connections will be accepted from anywhere, including outside of the machine

                – user907860
                Oct 5 '17 at 12:28





                it means incoming connections will be accepted on any IP address assigned to an interface - so this means from connections originating outside of your machine didn't you make an error here? You probably meant, that connections will be accepted, if they come on any address assigned to a given interface, regardless of their origin. The origin of incoming connections is probably specified in the next column Foreign Address. So it's there, if one has 0.0.0.0 as a value, it means that the connections will be accepted from anywhere, including outside of the machine

                – user907860
                Oct 5 '17 at 12:28




                1




                1





                @user907860 It might not be clear, but the distinction I am making is between 0.0.0.0 vs 127.0.0.1 - the latter will only accept connections from your machine, because it is listening on an unrouted IP address. Where as 0.0.0.0 means any address on your machine, and so provided they are routed, connections can be made from other machines.

                – Paul
                Oct 5 '17 at 22:22





                @user907860 It might not be clear, but the distinction I am making is between 0.0.0.0 vs 127.0.0.1 - the latter will only accept connections from your machine, because it is listening on an unrouted IP address. Where as 0.0.0.0 means any address on your machine, and so provided they are routed, connections can be made from other machines.

                – Paul
                Oct 5 '17 at 22:22













                Just FYI, -antu can be written as -tuna 🐟

                – Abdennour TOUMI
                Nov 10 '18 at 20:38





                Just FYI, -antu can be written as -tuna 🐟

                – Abdennour TOUMI
                Nov 10 '18 at 20:38













                12














                I compiled a small list myself.



                Some of my favorites are:



                netstat -tulpn
                lsof -i -n -P





                share|improve this answer






























                  12














                  I compiled a small list myself.



                  Some of my favorites are:



                  netstat -tulpn
                  lsof -i -n -P





                  share|improve this answer




























                    12












                    12








                    12







                    I compiled a small list myself.



                    Some of my favorites are:



                    netstat -tulpn
                    lsof -i -n -P





                    share|improve this answer















                    I compiled a small list myself.



                    Some of my favorites are:



                    netstat -tulpn
                    lsof -i -n -P






                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Oct 12 '12 at 7:34









                    jonsca

                    3,030112641




                    3,030112641










                    answered Oct 12 '12 at 6:02









                    robinrobin

                    12112




                    12112























                        7














                        A good and reliable way to check for ports opened is using ss (replacement for the deprecated netstat), it's usable in a script without requiring elevated privileges (i.e. sudo).



                        Usage: option -l for listening ports, option -n to bypass DNS resolution, and the filter on source port NN: src :NN (replace NN by the port you want to monitor). For more options, see man ss



                        ss -ln src :NN


                        Examples:



                        [user@server ~]# ss -ln src :80
                        State Recv-Q Send-Q Local Address:Port Peer Address:Port
                        LISTEN 0 128 *:80 *:*
                        [user@server ~]# ss -ln src :81
                        State Recv-Q Send-Q Local Address:Port Peer Address:Port


                        And in a script, using grep, we can test if the output contains the port we requested.
                        Example with port 80 in use (see above):



                        myport=80
                        # count the number of occurrences of port $myport in output: 1= in use; 0 = not in use
                        result=$(ss -ln src :$myport | grep -Ec -e "<$myport>")
                        if [ "$result" -eq 1 ]; then
                        echo "Port $myport is in use (result == $result) "
                        else
                        echo "Port $myport is NOT in use (result == $result) "
                        fi

                        # output:
                        Port 80 is in use (result == 1)


                        Example with port 81 not in use (see above)



                        myport=81
                        result=$(ss -ln src :$myport | grep -Ec -e "<$myport>")
                        if [ "$result" -eq 1 ]; then
                        echo "Port $myport is in use (result == $result) "
                        else
                        echo "Port $myport is NOT in use (result == $result) "
                        fi

                        # output:
                        Port 81 is NOT in use (result == 0)





                        share|improve this answer




























                          7














                          A good and reliable way to check for ports opened is using ss (replacement for the deprecated netstat), it's usable in a script without requiring elevated privileges (i.e. sudo).



                          Usage: option -l for listening ports, option -n to bypass DNS resolution, and the filter on source port NN: src :NN (replace NN by the port you want to monitor). For more options, see man ss



                          ss -ln src :NN


                          Examples:



                          [user@server ~]# ss -ln src :80
                          State Recv-Q Send-Q Local Address:Port Peer Address:Port
                          LISTEN 0 128 *:80 *:*
                          [user@server ~]# ss -ln src :81
                          State Recv-Q Send-Q Local Address:Port Peer Address:Port


                          And in a script, using grep, we can test if the output contains the port we requested.
                          Example with port 80 in use (see above):



                          myport=80
                          # count the number of occurrences of port $myport in output: 1= in use; 0 = not in use
                          result=$(ss -ln src :$myport | grep -Ec -e "<$myport>")
                          if [ "$result" -eq 1 ]; then
                          echo "Port $myport is in use (result == $result) "
                          else
                          echo "Port $myport is NOT in use (result == $result) "
                          fi

                          # output:
                          Port 80 is in use (result == 1)


                          Example with port 81 not in use (see above)



                          myport=81
                          result=$(ss -ln src :$myport | grep -Ec -e "<$myport>")
                          if [ "$result" -eq 1 ]; then
                          echo "Port $myport is in use (result == $result) "
                          else
                          echo "Port $myport is NOT in use (result == $result) "
                          fi

                          # output:
                          Port 81 is NOT in use (result == 0)





                          share|improve this answer


























                            7












                            7








                            7







                            A good and reliable way to check for ports opened is using ss (replacement for the deprecated netstat), it's usable in a script without requiring elevated privileges (i.e. sudo).



                            Usage: option -l for listening ports, option -n to bypass DNS resolution, and the filter on source port NN: src :NN (replace NN by the port you want to monitor). For more options, see man ss



                            ss -ln src :NN


                            Examples:



                            [user@server ~]# ss -ln src :80
                            State Recv-Q Send-Q Local Address:Port Peer Address:Port
                            LISTEN 0 128 *:80 *:*
                            [user@server ~]# ss -ln src :81
                            State Recv-Q Send-Q Local Address:Port Peer Address:Port


                            And in a script, using grep, we can test if the output contains the port we requested.
                            Example with port 80 in use (see above):



                            myport=80
                            # count the number of occurrences of port $myport in output: 1= in use; 0 = not in use
                            result=$(ss -ln src :$myport | grep -Ec -e "<$myport>")
                            if [ "$result" -eq 1 ]; then
                            echo "Port $myport is in use (result == $result) "
                            else
                            echo "Port $myport is NOT in use (result == $result) "
                            fi

                            # output:
                            Port 80 is in use (result == 1)


                            Example with port 81 not in use (see above)



                            myport=81
                            result=$(ss -ln src :$myport | grep -Ec -e "<$myport>")
                            if [ "$result" -eq 1 ]; then
                            echo "Port $myport is in use (result == $result) "
                            else
                            echo "Port $myport is NOT in use (result == $result) "
                            fi

                            # output:
                            Port 81 is NOT in use (result == 0)





                            share|improve this answer













                            A good and reliable way to check for ports opened is using ss (replacement for the deprecated netstat), it's usable in a script without requiring elevated privileges (i.e. sudo).



                            Usage: option -l for listening ports, option -n to bypass DNS resolution, and the filter on source port NN: src :NN (replace NN by the port you want to monitor). For more options, see man ss



                            ss -ln src :NN


                            Examples:



                            [user@server ~]# ss -ln src :80
                            State Recv-Q Send-Q Local Address:Port Peer Address:Port
                            LISTEN 0 128 *:80 *:*
                            [user@server ~]# ss -ln src :81
                            State Recv-Q Send-Q Local Address:Port Peer Address:Port


                            And in a script, using grep, we can test if the output contains the port we requested.
                            Example with port 80 in use (see above):



                            myport=80
                            # count the number of occurrences of port $myport in output: 1= in use; 0 = not in use
                            result=$(ss -ln src :$myport | grep -Ec -e "<$myport>")
                            if [ "$result" -eq 1 ]; then
                            echo "Port $myport is in use (result == $result) "
                            else
                            echo "Port $myport is NOT in use (result == $result) "
                            fi

                            # output:
                            Port 80 is in use (result == 1)


                            Example with port 81 not in use (see above)



                            myport=81
                            result=$(ss -ln src :$myport | grep -Ec -e "<$myport>")
                            if [ "$result" -eq 1 ]; then
                            echo "Port $myport is in use (result == $result) "
                            else
                            echo "Port $myport is NOT in use (result == $result) "
                            fi

                            # output:
                            Port 81 is NOT in use (result == 0)






                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Nov 23 '15 at 15:35









                            ThomasThomas

                            324412




                            324412























                                3














                                Another way:



                                telnet localhost <PORT_NUMBER>


                                If the port is free you will get an error. If the port is in use telnet will connect.



                                (found on http://www.unix.com/unix-for-dummies-questions-and-answers/8456-how-know-whether-particular-port-number-free-not.html)






                                share|improve this answer




























                                  3














                                  Another way:



                                  telnet localhost <PORT_NUMBER>


                                  If the port is free you will get an error. If the port is in use telnet will connect.



                                  (found on http://www.unix.com/unix-for-dummies-questions-and-answers/8456-how-know-whether-particular-port-number-free-not.html)






                                  share|improve this answer


























                                    3












                                    3








                                    3







                                    Another way:



                                    telnet localhost <PORT_NUMBER>


                                    If the port is free you will get an error. If the port is in use telnet will connect.



                                    (found on http://www.unix.com/unix-for-dummies-questions-and-answers/8456-how-know-whether-particular-port-number-free-not.html)






                                    share|improve this answer













                                    Another way:



                                    telnet localhost <PORT_NUMBER>


                                    If the port is free you will get an error. If the port is in use telnet will connect.



                                    (found on http://www.unix.com/unix-for-dummies-questions-and-answers/8456-how-know-whether-particular-port-number-free-not.html)







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Jun 30 '14 at 8:25









                                    AlgizAlgiz

                                    1315




                                    1315






























                                        draft saved

                                        draft discarded




















































                                        Thanks for contributing an answer to Super User!


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid



                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.


                                        To learn more, see our tips on writing great answers.




                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function () {
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f370965%2fhow-can-i-check-which-ports-are-busy-and-which-ports-are-free-on-my-linux-machin%23new-answer', 'question_page');
                                        }
                                        );

                                        Post as a guest















                                        Required, but never shown





















































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown

































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown







                                        Popular posts from this blog

                                        Probability when a professor distributes a quiz and homework assignment to a class of n students.

                                        Aardman Animations

                                        Are they similar matrix