Skip to content

Instantly share code, notes, and snippets.

@steinwaywhw
Created August 21, 2014 17:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steinwaywhw/60434276e544199d52b0 to your computer and use it in GitHub Desktop.
Save steinwaywhw/60434276e544199d52b0 to your computer and use it in GitHub Desktop.
One-liner to find out all ports being reserved in /etc/services

One-liner to Find Out All Service Ports being Reserved in /etc/services/

This script show you all the ports that are being reserved by other programs. It will be useful when you want to find an available range of ports.

grep -v "^#" /etc/services | awk '{print $2 " " $1}' | sort -n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment