Another fun related one: If your username is Tyler and you run shutdown, instead of the usual message it will say "Oh, good morning Mr. Tyler, going down?"
Discovered this in college when I was shoulder surfing a coworker who always used the username Tyler. When he typed shutdown I called it out, and he said, "wait, it doesn't do that for you? I always assumed it said that for everyone and just replaced the username!".
(For those of you too young to know, it's a reference to an Aerosmith song)
Personally I think ubiquitous software is even more important to have Easter eggs, because they're the most widely distributed, and we want as much joy as we could possibly have, before you know.
No, proper easter eggs don't introduce security issues, they're benign almost by definition. I think what made them disappear was the introduction of all the suit-wearing people who decide what the programmers are supposed to program, with no room for autonomous work within that.
Proper code doesn't either, and yet there they are! The point is they added another attack surface, however small, and another code path that should be tested.
When people started to care about 100% test coverage, they started to disappear.
> The point is they added another attack surface, however small, and another code path that should be tested.
I dunno, "attack surface" to me means "facilitate opening/vulnerability somehow" and none of the easter egg code I've seen has done that. You have any concrete examples where a easter egg made possible a security vulnerability that wouldn't be possible otherwise?
But yes, another code path created by easter eggs that wasn't tested I've seen countless of times, but never been an issue, but maybe our easter eggs always been too small in scope for that.
Or they were removed for other reasons than security.
In Star Trek: 25th Anniversary, we had a hidden animation of Captain Kirk's toupee jumping off his head and running out of the room. It was caught before release and they made us take it out since no one wanted to piss off William Shatner.
It should make you wonder instead about the appropriateness of testing over man(1) output, I suppose unless you're actually generating the format for use as man(1) input, in which case congratulations on your functional tests doing their job!
One very important section number is 5 - it's for file formats. So if you forget the crontab format, you need to invoke `man 5 crontab` to read about it.
In fact, the only reference to crontab(5) is in the SEE ALSO section (on my version anyway), but that doesn't say why you might want to see crontab(5), just that it exists. That is spectacularly useless
Depends. If one is aware of the meaning of section numbers, that "(5)" is very obviously suggesting that there is a file format named "crontab" which is documented. It's also pretty reasonable to suppose that the command and the file format of the same name are related.
A novice might miss the convention and the connection. Man pages are not quite novice material.
Maybe they could update man files so that it lists crontab(file format) instead of crontab(5)? Whenever I've seen numbered man pages in the past, I thought it was just a page number in the manual for the program
Hell, you don't even have to have a handle on what the section numbers mean for these things to be useful. The appearance of something in a "SEE ALSO" section indicates that the manual page author thought that that thing was both related to the thing being documented and worth reading if the current man page didn't answer all of your questions.
I can't count the number of times that following the trail laid out by 'SEE ALSO' sections a step or three has lead me to the exact thing that I never knew I needed to be using. Chasing those sections down is almost always well worth the three to ten minutes spent.
And, like, if one is expecting a man page to cover in detail everything even vaguely related to what it documents, and one doesn't feel one has ten minutes to spend reading things that people thought were important to bring to your attention... well, I guess one could go ask an LLM to slop out some related words. That'll probably take less than ten minutes, though correctness is not at all guaranteed.
That is incredibly stupid. A documentation system designed by someone who doesn't understand how people use documentation.
If man was designed by someone with any taste at all it would at least give you a menu to select (1) crontab command, (5) crontab file format. Maybe we need a rewrite in Rust to fix that.
And since man pages could take minutes to print out, if you needed one you'd tear that section of paper off and keep it in a binder for future (and faster) reference.
Programs these old are controlled by people who are very strongly opposed to change, even if it improves things. They like living in the 80s.
I absolutely guarantee if you propose this change the the GNU neckbeards who control man they will come up with some bullshit technical reason why it can't be done.
Not that I know of, but I haven't looked. I have written a similar program for pulling arm64 instruction pages (which have many duplicates), the whole thing is under 100 lines, and most of that is printing and file IO that would be handled by the manpager, the actual finding dups and presenting a menu is even simpler.
And maybe we need some versions: man version 1, man version 2 and so on. And of course, in the style of GTK, each one incompatible with all the others. Progress. /s
Incidentally, man --help on my machine shows "-k, --apropos equivalent to apropos", which isn't very useful. I know the two are equivalent, because they're on the same line of switches, what does it actually do?
With some further man digging, apropos is actually a separate program that looks through man page names/descriptions for the argument. Unless you run it with no arguments, in which case it just outputs "apropos what?" Instead of an actual error message like "No search term provided" or something
> Incidentally, man --help on my machine shows "-k, --apropos equivalent to apropos", which isn't very useful.
That's your hint to execute either 'man apropos' or 'man man'. Both tell you in detail what the flag and utility do.
You seem likely to be very disappointed in the '-h'/'-H' output of utilities from the BSD tradition. The output is often a list of all of the (almost always exclusively short) options presented as a sea of characters... and nothing else.
I mean, most of the -h/--help texts I've read are generally pretty good. Obviously not a full documentation for the program, but they tell you what the switches do. I wish there was a consensus on whether to use -h or --help though
Remarkable that no one yet here, including the article author, reports the true origin of these section numbers: they identified (depending on section size, one or a group of) physical binders in the series published by AT&T to document System V UNIX, and when you got an update to your system software, it came with a package of new manual pages which you would physically install in the binders to replace the now-superseded older versions. Everything you hate about man pages is in consequence of that origin, and of the corollary that the online version was never designed to be authoritative.
I have one of those physical binders, a volume of Section 3 for an AT&T 3B2, in the software section of my library downstairs. A beautiful artifact in every respect, of the level of quality you would imagine in the manual for a machine that cost $15,000 in the 80s.
My favorite piece of man trivia is from the source of the tunefs BSD man page, which contains:
.\" Take this out and a Unix Daemon will dog your steps from now until
.\" the time_t's wrap around.
.Pp
You can tune a file system, but you cannot tune a fish.
There was also the record You Can Tune a Piano, but You Can't Tuna Fish by REO Speedwagon, I had assumed that's what the tunefs man page was referencing as that was a best-selling record at around the time Unix was being developed.
Interestingly, the section doesn't actually have to start with a number. TCL man pages use the 'n' section and 'man' resolves them just fine despite the ambiguity. Conversely, manpage names can also start with numbers, although this is rare (I found only one such example: man 30-systemd-environment-d-generator)
may be a better version of what you propose, depending on what you're looking for. On my system, this also gives me entries from sections like '3x' and '3ossl' and '3bsd'.
Cool. And GNU "info" is a hyperlinked doc viewer system. Some GNU and other projects promote info doc as more authoritative than man pages. Man pages are expanded cheat sheets.
For in-depth doc, I do appreciate docset-based indexed search apps like Dash that can download and update comprehensive doc locally with greater performance and less internet dependency than internet only. There's even vim and nvim plugins to bring that to them too without leaving the terminal.
Note that this is contrary to the convention used in the Erlang community, where the number is used to disambiguate function definitions with different parameter counts, e.g. in https://www.erlang.org/docs/18/man/supervisor.html we see definitions of `start_link/2` and `start_link/3`.
It is a stylistic convention to always add this number to any reference to a function, even if there is only one definition.
That may "answer" a specific question. And all llms can do as they include manpages in training data (and any Agentic thing can search) however the value in reading documentation is that one can find different angles by learning about different options, which allow tontackle problems from a different perspective. The answer to a question is constrained by assumptions which are part of the question.
(discussed at https://news.ycombinator.com/item?id=27994194)