12

This is the twin to this question.

Most obscure/upvoted answer will get the answer vote!

Most Unix and Unix-like systems have a "traditional history" that is passed down with each generation, so that newcomers can see and understand some of the more esoteric portions of the system. What long-time *nix admins out there contribute as to the "Legendry" of "UNIX", as far as esoteric knowledge that new admins should be exposed to?

Avery Payne
  • 14,326
  • 1
  • 48
  • 87
  • 2
    Should wiki this, methinks – squillman Aug 13 '09 at 20:37
  • I will, in good time. ;) Truth be told, I have done several pure-play wikis, and unless there is even a hint of votes to be gained, *no-one will come*. Seriously, it works this way every time, without fail. People will not put in entries for a wiki unless it's absurdly non-work-related (i.e. favorite sysadmin cartoon, etc.) – Avery Payne Aug 13 '09 at 20:39
  • I hate saying this, but it has happened 3 for 3; each pure-play wiki was like pulling teeth. I even tried giving a bounty to one of them, and ouch, that *hurt* - no-one even bothered for 100 points!!! I promise to switch to a wiki in 60 minutes...so people, better get some answers in while you can ;) – Avery Payne Aug 13 '09 at 20:42
  • 2
    I've noticed the "no one comments in wikis" thing. That's so bizarre. People play serverfault like it's a video game. Dumb. – Matt Simmons Aug 13 '09 at 20:45
  • I have comments lurking in the SF database to that effect...I suspect that I need to head over to meta.stackoverflow.com and do a posting sometime, provided someone doesn't beat me to it with more community "steet cred" (nudge nudge, wink wink) – Avery Payne Aug 13 '09 at 20:47
  • 1
    I've noticed it as well, but (IMHO) doesn't mean we should encourage the rep-whoring... Let me know when you take it over to meta, they come up with some pretty good flames over there (trust me, you'll get it) :) – squillman Aug 13 '09 at 21:27
  • As promised, shifted into a wiki after 1 hour. – Avery Payne Aug 13 '09 at 22:00
  • 1
    I hate to say it...but I think there should be some kind of compromise. My general observation has been that if you reach a certain "critical mass", you can shift into a wiki and the question will continue to gather answres. So, I am wondering, if you set the wiki flag, maybe it should wait to enough answers to kick-start the question, and maybe after a preset time - say 3 hours - it kicks automatically into wiki. This is a good compromise, a balance between rewarding the people who are willing to start the process and making it a community effort based on contribution. Ideas? Comments? – Avery Payne Aug 14 '09 at 16:24
  • If this sounds like a half-reasonable approach, well, it's because I haven't thought the ramifications through. However, there definitely needs to be an overhaul on how wikis are handled. The Samba Wiki I started received barely any answers, and I was more or less the primary contributor to it. Here's a piece of software that is fairly well known in Open Source circles, but no-one appears to be (a) using it or (b) have any interesting experiences they would like to share. See http://serverfault.com/questions/19485/samba-server-implementation-details-and-best-practices for an example. – Avery Payne Aug 14 '09 at 16:28
  • To gather a few more answers, and give the late arrivals a chance at getting the vote, the question will remain open until Wednesday 19, at noon PST, when I will close it. – Avery Payne Aug 14 '09 at 16:45
  • meta.stackoverflow.com – Kyle Brandt Aug 18 '09 at 20:55

11 Answers11

20

A personal favourite has always been "The Case of the 500-Mile Email"

http://www.ibiblio.org/harris/500milemail.html

Spoiler

$ units
2411 units, 71 prefixes, 33 nonlinear units

You have: 3 millilightseconds
You want: miles
    * 558.84719
    / 0.0017893979
faultyserver
  • 1,904
  • 1
  • 16
  • 20
11

For me the most amazing thing about the UNIX tradition is that UNIX was basically written by one guy - Ken Thompson while at Bell Labs. There is a fascinating account of this that can be found here: http://www.bell-labs.com/history/unix/

Some of the quotes are just priceless:

"I allocated a week each to the operating system, the shell, the editor, and the assembler to reproduce itself...", Thompson explained.

Pipes:

Another innovation of UNIX was the development of pipes, which gave programmers the ability to string together a number of processes for a specific output.

It wasn't easy. "It's very easy to say 'cat into grep into...,' or 'who into cat into grep,'" McIlroy explained. "But there are all these side parameters that these commands have; they just don't have input and output arguments, but they have all these options."

Although stymied, McIlroy didn't drop the idea. "And over a period from 1970 to 1972, I'd from time to time say, 'How about making something like this?', and I'd put up another proposal, another proposal, another proposal. And one day I came up with a syntax for the shell that went along with the piping, and Ken said, 'I'm going to do it!'"

"He was tired of hearing this stuff," McIlroy explained. "He didn't do exactly what I had proposed for the pipe system call. He invented a slightly better one that finally got changed once more to what we have today. He did use my clumsy syntax."

"Thompson saw that file arguments weren't going to fit with this scheme of things and he went in and changed all those programs in the same night. I don't know how...and the next morning we had this orgy of one-liners."

"He put pipes into UNIX, he put this notation into shell, all in one night," McElroy said in wonder.

As technically neat as the accomplishment was, when Thompson created pipes, he also put something else into UNIX -- a philosophy.

As McIlroy described it, "the philosophy that everyone started to put forth was 'Write programs that do one thing and do it well. Write programs to work together. Write programs that handle text streams, because that is a universal interface.'"

HTTP500
  • 4,827
  • 4
  • 22
  • 31
8

tar never exits with an error. NEVER. Beware.

Source: The UNIX-HATERS Handbook, page 31 (http://simson.net/ref/ugh.pdf) Sorry, no HTML version.

This book happens to be chock-full of other legendry, and it's mostly still applicable. In my years of using Linux, I've run across many of these gotchas... just not any of the ones involving rm-ing my entire drive, thank goodness. It's stunning to me that so much of this book is still accurate, even though it was written over 15 years ago.

And now my own tar horror story, nearly an exact replica of the UNIX-HATERS one. Same bug, 14 years later!

I want my wireless working on my eeepc, for which I must download a driver, compile it, and install it. I download everything I need, and set off to the library to work. Halfway through, I realize that yes, I DO need the internet for something, so I go to install.

tar -cvf somewirelessdriver.tar ./importantcompilerfiles

Oh, crap. Did I just type -cvf instead of -xvf?

Yup.

Did tar just silently create a tar file of random garbage, overwriting my usable file?

Yup. Great. I guess I'll just do without internet access. Good thing it wasn't a multi-gigabyte file... Oh wait, that happened a week before.

Honestly, what the heck is up with cryptic command-line arguments and linux programs? Can't they just automatically do the basic operation when invoked on a file with the appropriate extension. Why in the blazes do I need to tell tar what to do with an ARCHIVE? Does it think that I might want to archive it AGAIN?

I think I finally understand what a 'tar pit' is, now. IT'S A PLACE THAT FILES GO TO DIE.

SilentW
  • 305
  • 1
  • 7
  • 1
    Wow. Just...wow. Any chance you can re-edit with a link on this? – Avery Payne Aug 13 '09 at 20:48
  • 4
    Come on, an error would mean that tar failed. You should just state the truth...tar never fails ;-) – Matt Simmons Aug 13 '09 at 20:50
  • Link added, as well as more commentary. As a side note, I did in fact buy my MSI Wind, spending an additional 350$, simply so that I didn't have to use Linux if I didn't feel like it. This story is one of the MANY reasons why. – SilentW Aug 13 '09 at 22:10
  • Is there anything you do nowadays to avoid these kind of tar errors? If so, do you have any answers for http://stackoverflow.com/questions/1122977/how-to-avoid-clobbering-files-when-creating-a-tar-archive – Andrew Grimm Dec 06 '09 at 03:21
7

Logging in with all caps

http://utcc.utoronto.ca/~cks/space/blog/unix/UnixFossilizationExample

hrm. I fear I may have misunderstood the question :-)

But I'm leaving the link, because I find it interesting!

Matt Simmons
  • 20,218
  • 10
  • 67
  • 114
  • Actually, the answer is spot-on; the intent of the question was to gather esoterica (much like its sibling question) from various people's experiences. – Avery Payne Aug 13 '09 at 20:43
6

The original pipe symbol was ^

The original delete key was #

The original "kill" key (erase everything on the line) was @

If you ever log onto an older system and can't seem to type a comment or an email address, stty becomes your friend.

This is an example 7th ed login session where the person making the log was gracious enough to run stty.. Also, as mentioned here it says "How to identify a traditional Bourne shell? 1 A simple check for an often undocumented but characteristic feature: You can use the circumflex ^ (caret) as replacement for | (pipe)."

chris
  • 11,784
  • 6
  • 41
  • 51
5

A famous Turing-award lecture of Ken Thompson:

http://www.ece.cmu.edu/~ganger/712.fall02/papers/p761-thompson.pdf [PDF]

When you put a backdoor for login in your C compiler, nasty things might happen...

liori
  • 737
  • 3
  • 14
3

NetBSD can run on just about anything. There are 57 (57!) supported ports:

http://www.netbsd.org/ports/#in-tree-ports

Cheers

HTTP500
  • 4,827
  • 4
  • 22
  • 31
2

Everything is a file, or can be treated as such... except the darn user.

Bus error means you are trying to execute data, which was stored on the data side of the PDP/11's split data/program bus.

Unix is the only O/S that got calenders and clocks right from the beginning, only because an astronomer was one of the creators. (Extra comment-credit: name that writer. Extra-extra credit: name the Olympic medal winner on the UNIX team.)

The GCOS field in /etc/passwd was named after the GECOS operating system, and placed there only because they were using a GECOS mainframe as a print server to the original Unix mini, and it needed the data to accept a print job.

kmarsh
  • 3,103
  • 15
  • 22
  • 1
    and networking. Who knows what they were smoking when making the BSD model of networking in unix, but it sure ain't unixy. – chris Aug 13 '09 at 21:22
  • AT&T implemented Streams to be a more UNIXy network API, and put a Socket API layer over it for compatibility. Then BSD (4.4 I think) added Streams as a compatibility layer API that called Sockets. – kmarsh Aug 13 '09 at 21:27
2

One that probably a lot of newcomers to Linux don't know is that the creator of Linux (Linus Torvalds) borrowed heavily from the MINIX Operating System (an educational tool) created by Professor Andrew Tanenbaum: http://en.wikipedia.org/wiki/Andrew_S._Tanenbaum#MINIX .

Linus and Prof. Tanenbaum also debated at length the merits/pragmatism of a monolithic kernel (Linux) versus a microkernel (MINIX, Solaris). The debate was public and can be found here: http://oreilly.com/catalog/opensources/book/appa.html

Cheers

HTTP500
  • 4,827
  • 4
  • 22
  • 31
2

The Art of Unix Programming is a good read for anyone interested in computing, not just those interested in Unix. Yes some of it is dated, but it is still an essential read.

goo
  • 2,838
  • 18
  • 15
1

A not so funny thing I did with tar once, and a tar that took a week to run:

  1. tar zcf foo.tar.gz ...
    • Some time during the next day or so, screen session was up on my screen: <UP>
    • A day or so later: <enter>
    • Tar finished , guess what to keys got held in the buffer, and entered into the shell the second after the tar finished ...

An upvote on their comment for the first person to explain what happened :-) The moral of the story, run stuff in the background of screen session.

That being said, I still love *NIX. I don't mind when things are messed up because it was my fault.

Kyle Brandt
  • 82,107
  • 71
  • 302
  • 444