2013-01-22

Find Unused Unix Ports

Problem:
You need to bring up another Unix web server but port 80 is already in use. How do you find another unused Unix port?

Solution:
(as one line)

netstat -ln | grep -v LISTENING | awk '{print $4}' | grep ":" | sort | uniq


You will get an output like

0.0.0.0:5353
0.0.0.0:68
0.0.0.0:80
10.0.2.15:123
::1:10089
::1:123

The number after the last colon is the port in use, e.g. 80, 123, 5353.  Pick any Unix port not already in use and assigned.

3 comments:

  1. Nurturingly encouraging positive childhood experiences, pbs kids shows offers engaging educational content filled with creativity, laughter, and meaningful lessons. Every episode supports children's development while making learning enjoyable through memorable adventures and inspiring characters they genuinely admire and remember.

    ReplyDelete
  2. Invitingly welcoming young players everywhere, pbs kids games delivers educational gameplay that encourages curiosity, exploration, and creativity. Every challenge motivates children to build valuable skills while enjoying colorful adventures that combine learning with exciting entertainment in meaningful ways.

    ReplyDelete
  3. Wonderfully this website presents captivating pipa combate fun through responsive controls, attractive graphics, and entertaining missions. Every gaming session feels fresh because the platform maintains excellent performance while delivering enjoyable experiences suitable for players of every skill level worldwide.

    ReplyDelete