Skip to main content
https://travis-ci.org/ncrocfer/whatportis.svg?branch=master

It often happens that we need to find the default port number for a specific service, or what service is listening on a given port.

Usage

This tool allows you to find what port is associated with a service :

$ whatportis redis
+-------+------+----------+---------------------------------------+
| Name  | Port | Protocol | Description                           |
+-------+------+----------+---------------------------------------+
| redis | 6379 |   tcp    | An advanced key-value cache and store |
+-------+------+----------+---------------------------------------+

Or, conversely, what service is associated with a port number :

$ whatportis 5432
+------------+------+----------+---------------------+
| Name       | Port | Protocol | Description         |
+------------+------+----------+---------------------+
| postgresql | 5432 |   tcp    | PostgreSQL Database |
| postgresql | 5432 |   udp    | PostgreSQL Database |
+------------+------+----------+---------------------+

Installation

$ pip install whatportis

Notes

  • You can search a pattern without knowing the exact name by adding the --like option :

$ whatportis mysql --like
+----------------+-------+----------+-----------------------------------+
| Name           |  Port | Protocol | Description                       |
+----------------+-------+----------+-----------------------------------+
| mysql-cluster  |  1186 |   tcp    | MySQL Cluster Manager             |
| mysql-cluster  |  1186 |   udp    | MySQL Cluster Manager             |
| mysql-cm-agent |  1862 |   tcp    | MySQL Cluster Manager Agent       |
| mysql-cm-agent |  1862 |   udp    | MySQL Cluster Manager Agent       |
| mysql-im       |  2273 |   tcp    | MySQL Instance Manager            |
| mysql-im       |  2273 |   udp    | MySQL Instance Manager            |
| mysql          |  3306 |   tcp    | MySQL                             |
| mysql          |  3306 |   udp    | MySQL                             |
| mysql-proxy    |  6446 |   tcp    | MySQL Proxy                       |
| mysql-proxy    |  6446 |   udp    | MySQL Proxy                       |
| mysqlx         | 33060 |   tcp    | MySQL Database Extended Interface |
+----------------+-------+----------+-----------------------------------+
  • “Why not use grep <port> /etc/services” ? Simply because I want a portable command that display the output in a nice format (a pretty table).

  • The tool uses the Iana.org website to get the official list of ports. A private script has been created to fetch regularly the website and update the ports.db file. For this reason, an update command will be created in a future version.

Release files for whatportis 0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for whatportis 0.4
File Size Uploaded
whatportis-0.4.tar.gz 258.9 kB Details

Release files / whatportis-0.4.tar.gz

Download URL whatportis-0.4.tar.gz
Size 258.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b03793a9871125f8bc72996941fe40a6efaa78c5c640e3d68d599d24599c9eb9
BLAKE2b-256 checksum
How to use checksums
89afe41aa0e52ca2ecb028e33c5686ed3960cee129455bd8ea21084847401214
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.8.2

2 release files

0.8.1

2 release files

0.8

2 release files

0.7

2 release files

0.6

1 release file

0.5

1 release file

This release

0.4 This release

1 release file

0.3

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page