Remix.run Logo
johnisgood 5 days ago

I must be very old school then. I am 30 years old, but I still read man pages often, whether I am writing C code, or just use an utility. It is a choice, however. I do not care if people use LLMs for this.

KingMob 5 days ago | parent [-]

I'm much older than that, and manpages have been a poor format for long time. I read manpages all the time, but I never like it.

They lack ToC, fast search, fuzzy searches, stem searches... really anything we've known to do with searches for the last 30 years. We're largely restricted to linear grepping and scanning.

GNU tried to make `info` happen, but it never caught on.

johnisgood 5 days ago | parent | next [-]

Manual pages do have "fast search" (with regexp supported), so I am not quite sure what you mean.

KingMob 5 days ago | parent [-]

Well, regexes, even with optimizations, are inherently linear searches, unlike a precomputed index (e.g., tries).

---

But the real problem with regexes is they force you mentally evaluate and skip over irrelevant hits, because it's not the right tool for excluding them.

Since regexes don't understand doc structure, you can't prioritize for a section heading with a word over other instances of the word.

Likewise for fuzzy search for longer phrases or cases where you're not sure of the precise order of multiple words.

They also lack stemming, so you either spend time constructing flexible regexes to handle related variants, or you run multiple searches with similar words.

Etc etc etc.

This is why text search engines are much more sophisticated than plain regexes.

---

Here's an example I ran into regularly when I was building a copy of bash's bind command:

How many irrelevant hits do you have to skip over to look up the the CLI options for bash's bind builtin? There's hits for the letters "bind" all over the manpage. And unfortunately the builtin options are near the end. I finally hit upon using "G" in less to jump to the end of the manpage, and then doing a reverse search for the hyper-specific phrase "BUILTINS", which takes me close to the right spot, but I only realized that after doing it a few times.

msgodel 5 days ago | parent | prev [-]

I think info probably would have been more popular if the local reader used HTML rather than info directly. Just the reader UI seems to turn people off to it.

Also man has "apropos" for search. It works pretty well IME.

KingMob 5 days ago | parent [-]

Agreed on `info`. Such a missed opportunity.

`apropos` is for listing possibly relevant manpages, but I'm thinking about searching within a manpage. Particularly a long one like bash's.

msgodel 5 days ago | parent [-]

typing / in the pager doesn't work for you?

KingMob 5 days ago | parent [-]

Not always. See my sibling comment for details, and an example of when a smarter search strategy would be better.