27

When reading a manpage for complex tools like rsync, or find, often there are options that imply several other options. Or like with wget the manpage will recommend a several options together for a certain situation. So consider this excerpt:

… Actually, to download a single page and all its requisites (even if they exist on separate websites), and make sure the lot displays properly locally, this author likes to use a few options in addition to -p:

wget -E -H -k -K -p http://<site>/<document>

At that point interested readers are essentially driven to do four separate searches on that manpage to chase down each of those options. So I hit: HOME / -E. Got lucky because the first match just happened to be the -E option and not chatter about “Content-Encoding”.

Then what? I forgot all options I need to search for and lost my starting place, so I had to browse/search back to where I was to learn that I next need to search for -H. Then I hit: HOME / -H. It brings me to an irrelevant match on “non-HSTS-compliant”. So I must hit / ENTER many times until I reach the right position. Searching for -k is tedious too. …And so on…

With rsync the -a: “archive mode is -rlptgoD (no -A,-X,-U,-N,-H)”. Rsync is not a disaster though as they took care to summarize all options with a one-liner in one place.

Anyway, unless I am missing a trick¹, it seems there must be a lot of time waste with users having to jump around using a dicey search mechanism prone to false positives.

¹ In the course of writing this rant, I discovered I could search the rsync man page by doing /-a\>, which at least skips past many false hits by specifying a word boundary. Still more tedious than it has to be though.

all 11 comments
sorted by: hot top new old
[-] toynbee@lemmy.world 11 points 10 months ago* (last edited 10 months ago)

It's not exactly what you're describing, but you can grep man output:

man wget | grep -A 3 -- -E
[-] azdle@news.idlestate.org 8 points 10 months ago

Be the change you want to see in the world?

I've always thought it would be interesting to have a shell that can (semi-?)automatically expand short flags into long flags for you.

[-] chonkyninja@lemmy.world 3 points 10 months ago
[-] LibreMonk@linkage.ds8.zone 1 points 10 months ago

Really? Zsh expands short parameters to long? My search comes up dry. This is apparently the most comprehensive treatment on the topic:

https://thevaluable.dev/zsh-expansion-guide-example/

I don’t see mention of tool options expanding.. just other parameters like variables.

[-] Atherel@lemmy.dbzer0.com 3 points 10 months ago

Not exactly what you're looking for but I stumbled upon the following link yesterday on lemmy:

https://codeberg.org/chimay/blog/src/commit/02bdd1d592f7130c2dd2cc13e35a63c551387e91/meta/man-pages.org

[-] devtoolkit_api@discuss.tchncs.de 1 points 3 months ago

Have you tried tldr? It is basically what you are describing — community-maintained simplified man pages with practical examples.

tldr wg

Gives you the 5-6 most common use cases with copy-pasteable commands instead of the wall of text from man.

Install with pip install tldr or sudo apt install tldr on most distros. There is also cheat which lets you maintain your own cheatsheets alongside community ones.

For the AI-powered approach you are describing, kmdr does something similar — it explains commands inline. But honestly tldr covers 90% of use cases and works offline.

[-] LibreMonk@linkage.ds8.zone 1 points 3 months ago

The tldr app is in Debian official repos so I installed it with apt tools. From there, it failed me:

$ tldr wg
Downloading tldr pages to ~/.local/share/tldr
tldr: HttpExceptionRequest Request {
  host                 = "tldr.sh"
  port                 = 443
  secure               = True
  requestHeaders       = []
  path                 = "/assets/tldr.zip"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
  proxySecureMode      = ProxySecureWithConnect
}
 (ConnectionFailure Network.Socket.getAddrInfo (called with preferred socket type/protocol: AddrInfo {addrFlags = [], addrFamily = AF_UNSPEC, addrSocketType = Stream, addrProtocol = 0, addrAddress = 0.0.0.0:0, addrCanonName = Nothing}, host name: Just "tldr.sh", service name: Just "443"): does not exist (Temporary failure in name resolution))

Looks like it needs cloud access. My gear only works on Tor, so then I tried it this way:

$ torsocks tldr wg
No tldr entry for wg
$ torsocks tldr wget
No tldr entry for wget
$ torsocks tldr find
No tldr entry for find
$ torsocks tldr rsync
No tldr entry for rsync
$ torsocks tldr -u
Downloading tldr pages to ~/.local/share/tldr
tldr: Data.Binary.Get.runGet at position 4: Did not find end of central directory signature
CallStack (from HasCallStack):
  error, called at libraries/binary/src/Data/Binary/Get.hs:351:5 in binary-0.8.8.0:Data.Binary.Get

Also checked for kmdr but that’s not in the official debian repos, which I try to stick to. I appreciate the tips though.

[-] BeliefPropagator@discuss.tchncs.de 1 points 10 months ago

I like to search for " -E" (with a preceding space) to avoid false-positives, but yeah...

[-] Sxan@piefed.zip -1 points 10 months ago

man is fantastic, but I agree þat þe pager could be better. Þere's enough information in þe roff format for smarter tools, but it's only used for formatting. An ideal tool would parse þe source, extract navigation information (like, building an index would be trivial), and þen boþ render and provide navigation aids.

As long as it didn't get as complex as GNU info; þat's more trouble þan it's worþ.

Great idea for a utility project.

this post was submitted on 24 Aug 2025
27 points (90.9% liked)

Linux

2234 readers
1 users here now

Everything about Linux

RULES

founded 3 years ago
MODERATORS