Settings

Theme

Gems from the man page trenches (2016)

saminiir.com

62 points by LEARAX 3 years ago · 27 comments

Reader

somat 3 years ago

My favorite man page is scan_ffs.

http://man.openbsd.org/scan_ffs

    The basic operation of this program is as follows:
    
    1.  Panic. You usually do so anyways, so you might as well get it over with. Just don't do anything stupid. Panic away from your machine. Then relax, and see if the steps below won't help you out.
  • smcameron 3 years ago

    Ha. I wasn't familiar with scan_ffs, so I googled it. Given what it does, or purports to do, yeah, a first step of "Panic" makes total sense. Reminds me of something which happened early in my career. An older, wiser coworker came by and said, "You won't believe what I almost did. I was installing a new disk on cyclops (our main NFS server), and I almost typed 'newfs /dev/sda' instead of 'newfs /dev/sdb'" (this was on SunOS 4, iirc). Then he went back to his office, hit return a couple times and... he had left "newfs /dev/sda_" sitting there on the command line. Panic ensued. We recovered from backup tapes.

    • teddyh 3 years ago

      For those who are wondering: The Linux equivalent is “findsuper”, which is from the e2fsprogs package, but the “findsuper” command is not normally built and installed, so when you need it, you will have to download the e2fsprogs source and compile findsuper yourself. An unnecessary pain at the worst possible time, sadly.

    • sen_armstrong 3 years ago

      > so I googled it

      uh... the man page? XD

    • yuubi 3 years ago

      sunos4 disk devices were named like xy0a or xd2h or sd1b. the first 2 letters were the controller (xy/xd were different types of xylogics smd controllers, sd scsi), the number was the unit number, and the letter was the partition, with some fairly strong conventions (a=root, b=swap, c=whole disk, d..h=other)

mixedmath 3 years ago

I love man pages. But it took me many years before I realized how easy it is to write man pages for tools that I write (and further, I write in markdown and pandoc happily translates them to troff for me).

A few years ago I learned that one can also add a new section to man. I've added the `eg` section, which I fill with examples that I think will be useful to future me. For example, typing `man eg awk` opens up my man page of examples for awk, which is more pointed.

nagonago 3 years ago

> They are almost without exception well-written and concise, and the intuition you gain for particular topics as you browse through the man pages is well worth the effort. In contrast, many developers shoot straight to googling the answer for the problem at hand.

Maybe worth the effort if you want to learn about a program in detail, but in practice I often give up reading the manual and use google instead because I just want to know/remind myself the most common use cases. To be fair, there are some man pages that have a great USAGE or EXAMPLES section which meet this purpose.

smcameron 3 years ago

If you create and distribute an executable for linux/unix, and you don't create a man page for it, you are committing a crime against humanity.

  • runlevel1 3 years ago
    • eichin 3 years ago

      Huh, I wonder how close that is to what `ronn` does (also markdown to man, via a couple of paths, written in ruby.)

  • enriquto 3 years ago

    > If you create and distribute an executable for linux/unix, and you don't create a man page for it, you are committing a crime against humanity.

    I agree.

    And it's so easy to do! As long as your program has a --help option, creating the manpage simply amounts to calling help2man. Just add this to your makefile:

        foo.1 : foo ; help2man -N foo > foo.1
thepostman0 3 years ago

man has an Easter egg for anyone interested:

https://git.savannah.gnu.org/cgit/man-db.git/commit/?id=84bd...

hyperman1 3 years ago

I remember some old man page (su? sudo?) complaining quite bitterly about the wheel group not sharing its power or something, but can't seem to remember it.

euroderf 3 years ago

Didn't GNU man pages use to have a lot more examples in the 90s ? At some point (IIRC) examples were purged. A great disservice.

  • Y_Y 3 years ago

    I don't remember what exactly happened, but a lot of manpages moved over to `info` and `man` would just complain and send you there.

    These days I use `tldr` (via `tealdeer`) and that usually spits out a few nice example commands.

  • codeflo 3 years ago

    Was there a rationale?

    • enriquto 3 years ago

      "The GNU folks, in general, abhor man pages, and create info documents instead."

crawl_soever 3 years ago

My favorite is entering "extreme bounce zone"Just take a look at the stupid tricks sampler at the end of GNU man!

mturmon 3 years ago

The best pages are terse. My favorite snippet:

    Sharp and newline surround comments.
I think from a old awk man page?
danrl 3 years ago

My fav:

"You can tune a filesystem, but you can't tune a fish." --tunefs(8), 4.2BSD and later

yaccz 3 years ago

POSIX_ME_HARDER

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection