For many, many years now when I want to browse a man page about something I'll type man X into my terminal, substituting X for whatever it is I wish to learn about. Depending on the manual, it's short and therefore easy to find what I want, or I am deep in the woods because I'm trying to find a specific flag that appears many times in a very long document. Woe is me if the flag switch is a bare letter, like x.

And let's say it is x. Now I am searching with /x followed by n n n n n n n n N n n n n n. Obviously I'm not finding the information I want, the search is literal (not fuzzy, nor "whole word"), and even if I find something the manual pager might overshoot me because finding text will move the found line to the top of the terminal, and maybe the information I really want comes one or two lines above.

So... there HAS to be a better way, right? There has to be a modern, fast, easily greppable version to go through a man page. Does it exist?

P.S. I am not talking about summaries like tldr because I typically don't need summaries but actual technical descriptions.

  • pr06lefs@lemmy.ml
    ·
    edit-2
    2 months ago

    Kind of off topic, but you know what would be cool? If you had an 'man explain' command that would define all the flags/args in a command, like:

    man explain rsync --append-verify --progress -avz -e "ssh -p 2222" root@$dip:/sdcard/DCIM/Camera newphonepix

    Would give you:

    rsync - a fast, versatile, remote (and local) file-copying tool
          --append-verify          --append w/old data in file checksum
          --progress               show progress during transfer
          --archive, -a            archive mode is -rlptgoD (no -A,-X,-U,-N,-H)
          --verbose, -v            increase verbosity
          --compress, -z           compress file data during the transfer
          --rsh=COMMAND, -e        specify the remote shell to use 
    

    etc.

    • gomp@lemmy.ml
      ·
      2 months ago

      Here's what I get in fish when I start writing a rsync command and hit tab to ask for completions:

      ❱ rsync --append-verify --progress -avz -
      -0  --from0                               (All *from/filter files are delimited by 0s)  --delete                   (Delete files that don’t exist on sender)
      -4  --ipv4                                                               (Prefer IPv4)  --delete-after         (Receiver deletes after transfer, not before)
      -6  --ipv6                                                               (Prefer IPv6)  --delete-before         (Receiver deletes before transfer (default))
      -8  --8-bit-output                          (Leave high-bit chars unescaped in output)  --delete-delay                 (Find deletions during, delete after)
      [more lines omitted]
      
    • TeddyKila [comrade/them]
      ·
      2 months ago

      Fish does this but is intentionally POSIX noncompliant so you'd wanr to keep the old shell installed if you run other people's script.

  • ExtimateCookie
    ·
    2 months ago

    Still waiting for someone to create Woman

  • bastion@feddit.nl
    ·
    2 months ago

    Man pages this, man pages that. When will the Linux community start really thinking about woman pages?

  • PseudoSpock@lemmy.dbzer0.com
    ·
    2 months ago
           man -k printf
               Search  the short descriptions and manual page names for the keyword
               printf as regular expression.  Print out any matches.  Equivalent to
               apropos printf.
    
  • jeffreyosborne@lemm.ee
    ·
    2 months ago

    I like tldr. It doesnt give incredibly in depth explanations, but it does show the basics of using most commands.

    • rotopenguin@infosec.pub
      ·
      2 months ago

      I have to remember to use tldr, one of these days. Some manpages get so lost in the pedantry of covering everything that the 99 percentile stuff is buried.

    • underisk [none/use name]
      ·
      2 months ago

      https://tldr.inbrowser.app/ for anyone curious. There’s also a command line version you can install.

  • Tovervlag@feddit.nl
    ·
    edit-2
    2 months ago

    I lately often use chatgpt for these kind of things. It's amazing in breaking down the parameters and what they mean. Verify, especially when the problem is hard and apparently unfindable. Chatgpt won't find it either. It sometimes makes up things in these scenarios.

    edit: You guys are allowed to not like my post but it really helps me so why not try it instead of just downvoting.

  • wuphysics87@lemmy.ml
    ·
    2 months ago

    You can search via regex. For instance you know a section heading or flag is the first thing on a line preceded with spaces. I also find it earier to read with extensions for colors.

  • sping@lemmy.sdf.org
    ·
    2 months ago

    Sorry it's not a very direct answer but this is one of the many things that make Emacs such a comfortable environment once you're used to it, which takes ... a while.

    There is a man command and then of course it's just more text displayed so you can search and narrow and highlight etc. in the same way you do with any other text. Plus of course there are a few trivial bonuses like links to other man pages being clickable.

    It's all text and Emacs is a text manipulation framework (that naturally includes some editors).

  • ssm@lemmy.sdf.org
    ·
    edit-2
    2 months ago

    the / and ? commands in the pagers more and most less implementations should support regular expressions (usually BREs in my experience); which is the same thing grep uses. Consider reading your friendly neighborhood regex formatting manpage, if you are confused. As for easily scrolling, ^G to terminate your search followed by b (or your favorite vi or emacs scrolling bind) to scroll back should be sufficient.

    Also, man some-manpage | grep expression works, if you didn't know.