35

I have often started to think about this but never found a good answer. Why are these two Unix directories not /user and /temp instead?

All the other directories under root seem to be exactly what one would guess them to be, but these two seem odd, I would have always guessed them as user and temp.

Is there some historical reason for the spellings?

Lazer
  • 35,307
  • 2
    Something tells me it's a carryover from Unix. On that assumption, I'd guess that most such truncations are based on prominent syllables. – Ken Mar 06 '11 at 06:32
  • 18
    Once, Ken Thompson was asked if he'd do anything different were he redesigning Unix, and he replied ""I'd spell creat with an e." – mattdm Mar 06 '11 at 07:08
  • 3
    "All the other directories under root seem to be exactly what one would guess them to be" -> That doesn't seem true to me. Except for boot, home, media and root everything else is shortened. mnt also lack its vowels. – phunehehe Mar 06 '11 at 09:32
  • 7
    I thought 'u' was a vowel... – Mr. Shickadance Mar 06 '11 at 16:04
  • 1
    @Mr. Shickadance: it is. – 0xC0000022L Mar 07 '11 at 11:49
  • I heared /usr stands for unix system ressources, not user. But I too heard that it is another myth. :) I don't have evidence. – user unknown Mar 08 '11 at 01:10
  • 1
    Sounds like we need a book: "On the origin of Unix, a journey through dyslexia" :-). – Stein Åsmul Jun 11 '11 at 18:15
  • All the "directories with readable names" are much newer conventions in Unixland... – vonbrand Mar 18 '13 at 17:10
  • The "other directories" you mention (/boot, /home, and so on) are much later additions, perhaps even introduced in some Linux distribution. – vonbrand Mar 01 '20 at 02:34

5 Answers5

49

Yup there were reasons. They are pronounced user and temp. passwd is similar, as is resolv.conf. Unix is an expert friendly, user antagonistic operating system.

I was a student when 300 Baud modems were the norm. I was the envy of my fellow students, since I had a Silent 700 terminal from Control Data where I was working. You could see the delay from typing each character and waiting for it to be echoed. Every character counted; I also see it as fostering the start of leet speak.

The hjkl from vi have a history which few know. vi was developed by Bill Joy when he was a grad student at UCB during these same years. The ADM 3a terminals in Cory Hall had arrow keys above those letters

  • 23
    I don't think that when it was designed the idea of being "expert friendly, user antagonistic" was part of the goal. Rather, all of the users were experts, so there was no meaningful distinction. – mattdm Mar 06 '11 at 07:16
  • 7
    LOL "Experty friendly, user antagonistic". It made my day. +1! – nico Mar 06 '11 at 09:21
  • 6
    Just a small note (not a correction by any means). Though it is sometimes pronounced "user", /usr stands for either "universal system resource" or "unix system resource". Whichever that is, it's been lost amid the fog of Unix's ancient history :) – luis.espinal Mar 06 '11 at 14:06
  • 22
    At the time /usr was coined, its meaning was user and home directories were located there. unix/universal system resource is actually a backronym. – jlliagre Mar 06 '11 at 14:32
  • 3
    When Unix came out 300 bps was lush. There were 75 bps links out there, handled by cumbersome, slow, electromechanical teletypewriters (often Teletype® ASR-33). – Alexios Jan 12 '12 at 16:03
  • 1
    @luis.espinal Not true. Dennis Ritchie himself has said it was for user home directories on a slower disk. Although unfortunately the notes page where this is documented is no longer available on Bell Labs website nor was it archived on archive.org. :-( However his quote is found other places online. – deltaray Oct 05 '16 at 15:06
  • 1
    Related: Youtube: AT&T Archives: The UNIX Operating System (produced around 1982) where, at about 13min 35sec, /usr/bwk is clearly pronounced "user-b-w-k" and /usr is pronounced "slash-user" by Brian W. Kernighan. /usr is also clearly implied to be the location containing home directories in the diagram at 13min 30sec. I don't think you can get much more authoritative than that. // cc @luis.espinal – user Apr 22 '17 at 12:05
21

They are holdover from Unix. Memory and disk space was in short supply. Hacking out a few vowels and other abbreviations gave real savings. A few disk blocks or a few bytes could mean the difference in being able to run a program or not. (I once had to trim a program by 24 bytes before it would run.)

Also as Tom noted terminal speeds were slow. 1200 baud was introduced as high speed and it was. I worked with one system that used a half speed teletype (55 baud or 5 cps) as the console.

On systems running graphical interfaces it generally doesn't matter that much as the average users won't be poking around in them. The directories are usually well documented in the hier man page.

Changing over to longer names would cause a lot of problems for existing programs. It would also limit script portability. Linking multiple names to the same directories would likely be more confusing than helpful.

EDIT: PDP-7 on which Unix was developed had a base configuration of 4KW of memory and a maximum of 32KW. Words where 18 bits wide. Input was a teletype, so speed was likely 110 baud or 10cps, roughly 100 words which is significantly slower than speech.

BillThor
  • 8,965
  • 8
    I don't buy mmory nd dsk spc, but slow tltyps. As long s you cn dcphr th cronyms - why not? – user unknown Mar 06 '11 at 10:47
  • @user unknown: Then you are young and never had to worry about memory or disk space. My first computer is 30 years old now - marvel at the specs. –  Mar 06 '11 at 13:47
  • 1
    I have never written or inspected a filesystem in depth, but does the name of a file/directory in the filesystem occupy more or less space, depending on 1 character? The files themselves always occupy a multiple of some size - today 4k. So most files which contain a path to /usr or /tmp will not effectively get smaller or bigger, depending on a single e. Well - sometimes they will, and then they grow for a whole blocksize, but rarely. And in RAM? I don't know. – user unknown Mar 07 '11 at 01:05
  • 1
    and it would have been more annoying to type. "temporary vs tmp" ugh... why would anyone want them longer? – xenoterracide Mar 07 '11 at 02:20
  • 4
    Modern Unix directories have variable-length entries. Back in Research Unix, a directory entry was a fixed 16 bytes: 14 for the filename, 2 for the inode number. And it may have been smaller when /usr etc. were canonized. – geekosaur Mar 07 '11 at 08:38
  • Most file systems store the file in blocks. Sizes range from 512 bytes on up in powers of 2. Available sized depend on the file system. Some filesystems will store the tail (partially filled last block) in the inode stucture. Occupied space may be more closely related to the number of bytes, than is found with systems that only use block level storage. – BillThor Mar 07 '11 at 17:21
  • Just to add to this, there were/are limits on total length of a path in Unix, which I ran into a few times over the years, so that's a factor too. I agree it was almost certainly driven mostly by brevity in typing and space saving consideration though. – Iain Collins Jan 18 '19 at 11:21
5

A factor that nobody has mentioned is that, given the keyboard technology of the time, there was a substantial advantage in using short names that are easier to type. Printing user vs. usr, even on a 110-BPS teletype, probably wasn't a huge deal; having to type that extra letter was probably more significant.

5

I'm surprised that nobody has commented on /user yet. This one is obvious: because it's not "user", it's "Universal System Resources".

As for /tmp, it's simply shorter and easier to type. C programmers have a habit of using short names when possible because they end up typing them many times in a program. It is very common have a temporary variable named "tmp" rather than "temp" for the same reason, you use "i" i for the index in a for loop instead of "index" or "counter".

Shawn J. Goff
  • 46,081
  • 24
    At the time /usr was coined, its meaning was user and home directories were located there. unix/universal system resource is actually a backronym. – jlliagre Mar 06 '11 at 14:33
  • 4
    @jlliagre Awesome. I found another thread that actually has an authoritative source of that. http://us.generation-nt.com/answer/opt-vs-usr-local-help-200302801.html?page=5 – Shawn J. Goff Mar 06 '11 at 16:01
  • 2
    Most early C programmers were first FORTRAN programmers. The way you typed integers in Fortran IV was to start the identifier with a character from 'i' to 'n', everything else was a REAL number. Thus loop indices were typically i, j, or k; which was sufficient for the matrices we scientific programmers were mangling back then. – Tom Murphy Apr 05 '11 at 05:56
  • @TomMurphy, most people who started with C were probably assembly language programmers, or perhaps BCPL or B users. RATFOR was invented for the poor souls who didn't have a decent language at hand. And the Kernighan and Plaugher book "Software tools" was written in (and lists a full preprocessor for) RATFOR. Still very much worth a read. – vonbrand Mar 18 '13 at 17:09
  • 3
    /usr wasn't "Universal System Resources", it really was user. See Youtube: AT&T Archives: The UNIX Operating System (produced around 1982) where, at about 13min 35sec, /usr/bwk is clearly pronounced "user-b-w-k" and /usr is pronounced "slash-user" by Brian W. Kernighan. /usr is also clearly implied to be the location containing home directories in the diagram at 13min 30sec. I don't think you can get much more authoritative than that. – user Apr 22 '17 at 12:09
  • @ShawnJ.Goff: ...aand it's gone. – Piskvor left the building Jan 18 '19 at 10:38
  • Perhaps this is it? http://lists.busybox.net/pipermail/busybox/2010-December/074114.html – Piskvor left the building Jan 18 '19 at 10:46
1

All the other directories under root seem to be exactly what one would guess them to be,

There is also /var, /mnt and /opt ;)

but these two seem odd, I would have always guessed them as user and temp.

Almost there. As Shawn said, "user" stands for "Universal System Resources" (though other resources according to the google indicates it stands for "Unix System Resources").

Is there some historical reason for the spellings?

Short cuts, abbreviations. Remember that commands in any operating system are meant for accessing both interactively and programmatically. In particular for systems administration where fast scripting is one primary concern, abbreviations, mnemonics are as good (or even better) than the full spelled word/command.

Also, back in the day, if you were connecting remotely through a slow-as-molasses modem, shaving a couple of vowels here and there would make your life easier (or less miserable if you were a sysadmin trying to find out what the hell is wrong with a remote box.)

As said before, it is not unique to /usr and /tmp (see /var, /mnt and /opt).

Also, it is not unique to Unix. Take DOS for example (chkdsk, for example.) Mnemonics where you shave off vowels are a powerful, handy concept.

Even in natural languages (like Semitic languages) the concept exists (where root of words are universally and almost unambiguously identified by 3-consonant groups.) It is an innate human mechanism for managing information.

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
  • 1
    The /var, /mnt and /opt came MUCH later. However, /bin, /dev, and /etc were in very early UNIX and for the same reason people stated - because ttys were slow and not all were CRT and disk space. There were UNIX boot systems out there using paper tape, small (space-wise) expensive drives and even 8" floppies. Space for those were at a premium. – Arcege Mar 06 '11 at 15:31
  • 1
    It could be argued that semitic languages don't actually use consonants, but syllables with indeterminate vowels. So, the root syllables provide semantic meaning, while the specific vowels add grammatical meaning. – ninjalj Dec 02 '13 at 11:43