SUB(1)
π SUB(1) β like, the manual page, bestie π
okay so real talk, you found the man page for sub from the SUB(1) manual, and honestly? she's a baddie. let's get into it π«Ά
β¨ NAME β¨
sub β subscribe to MQTT topics πΈ
β¨ SYNOPSIS β¨
sub [OPTIONS]
that's it. that's the whole vibe. no positional args, just options, and she eats every time π
β¨ DESCRIPTION β¨
sub connects to the MQTT broker you tell her about and subscribes to all the topics you specify. Every message that comes in on a topic gets printed to stdout, and it's prefixed with the topic the message arrived on, so you always know who's talking. main character behavior tbh π
and here's the cute part: every single option can be passed either as a command-line argument or written in a simple config file. your choice, your rules, no cap β¨
β¨ OPTIONS β¨
-auto-reconnectβ automatically reconnect when connection is lost. she comes back. she always comes back π¦-broker URLβ broker address (should be in the form of a URL)-ca-root FILEβ path to a FILE containing CA certificates (optional)-cert-file FILEβ authenticate with a certificate π-cleanβ discard any pending messages from the broker (defaulttrue)-client-id STRINGβ unique identifier for this client (defaults to a semi-random string)-connect-retryβ automatically retry initial connection to broker π-connect-retry-interval DURATIONβ wait DURATION between initial connection attempts (default30s)-config FILEβ path to FILE containing configuration values (optional)-header KEY=VALUEβ set an HTTP header (inKEY=VALUEform) (can be specified multiple times)-key-file FILEβ authenticate with a private key π-password STRINGβ authenticate with a password-qos INTEGERβ quality of service for messages-tls-alpn STRINGβ ALPN value to include in the TLS handshake (can be specified multiple times)-topic STRINGβ topic to publish or subscribe to (can be specified multiple times) π-username STRINGβ authenticate with a username-verboseβ increase output π£οΈ-versionβ print version
β¨ CONFIGURATION β¨
Any option may be specified as a value in a configuration file instead of (or in addition to) a command-line option. like, you don't have to pick one, you can do both, it's giving polyamorous but for flags π
Values present on the command-line take precedent over values in the configration file. so the command line always wins, periodt π
Thus it is easy to create a base configration file that can be augmented easily at run time. build your little base, then spice it up on the fly. iconic.
The configuration file takes the form of a simple space-separated "option value" format (i.e. "broker tcp://test.mosquitto.org:1883").
ngl bestie, the original spells it "configration" twice β that's a typo in the man page itself, not a you problem. i'm keeping it exactly as written because facts are facts π
β¨ EXAMPLES β¨
Connect to a broker anonymously and subscribe to two topics. β¨
sub -broker tcp://test.mosquitto.org:1883 -topic mqttcli/pubtest -topic mqttcli/pubtest1
Connect to a broker using username/password authentication and subscribe to a topic. π
sub -broker tcp://test.mosquitto.org:1884 -username ro -password readonly -topic mqttcli/pubtest
β¨ AUTHOR β¨
Link Dupont <link@sub-pop.net>
- Author. π
and that's the whole page, bestie!! this was SUB(1), dated 08/22/2026, and it's lowkey a masterpiece. go forth, subscribe to your topics, and slay π
β¨ππ¦πΈππ«Άπ
π¦ where this page comes from
- fedora 43: mqttcli 0.2.8-2.fc43 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND EPL-2.0 AND GPL-3.0-only AND MIT AND Unlicense
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms