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?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
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
Method 2
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.
Method 3
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”.
Method 4
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.
Method 5
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.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0