Fog Creek Software
Discussion Board




dumb Unix question

What is the meaning of "etc" as a name for a directory? Also "var?"
I have been wondering about this for years but I didn't want to ask anyone, since it doesn't matter. But every time I look at those directories, I have to wonder.
I also wonder about the meaning of /usr/local. It's "local" as opposed to what?
(Sorry, I just don't have much to do at this moment. I finished a project that I thought would never end, and the next one starts tomorrow afternoon. I will finally have a chance to sort my e-mail.)

PC
Wednesday, February 19, 2003

Local meaning your local, individual system, as opposed to the entire cluster.

(Many unix instalations are designed to have some large number of systems all working off of the same NFS mount)

flamebait sr.
Wednesday, February 19, 2003

Actually, I may have gotten that wrong.  It might also be that /usr/local/ is for stuff that is not part of your OS install, meaning things you install.

There's years and years of history that makes things work like this and sometimes the reasoning doesn't make complete sense now.

flamebait sr.
Wednesday, February 19, 2003

You could call "var" the variable stuff because it consists of files that are always changing: system logs, outgoing mail queues and incoming mail files,...

If you are careful, you can set up your partitions so that /usr is readonly and all the system writable files are on /var.  This can protect executables and libraries from corruption, intentional or accidental.

mackinac
Wednesday, February 19, 2003

/usr/local sure isn't local to the machine I am using.  I think it more generally refers to components that aren't part of the normal system installation, but are added later.

mackinac
Wednesday, February 19, 2003

Short story:

Since the beginning, there has been a set structure of
directories in Unix (with minor diffs between Sys V and BSD), but the simple thing is:

$ls / normally gives:

/dev , /etc , /bin , /var, and so forth...

This is directories under the root, which holds binaries and confing information for the things that is part of standard UNIX.

Under /usr/local/* you would normally have the same directory structure as in your / directory. This is where your local stuff goes, emacs, oracle, mySQL, Apache or what have you.

The /usr/local structure was initially done in BSDish systems, (BSD obviously and SunOS 4). However when Solaris 2 and RedHat Linux and other System Vish systems came along, some people started obsessing about replacing the /usr/local/* with /opt/*. (optional stuff). So on Solaris systems you often see /opt/bin/emacs, or even /opt/local/bin/emacs, instead of /usr/local/bin/emacs.

Another difference between BSD and System V, is the /etc/ and /usr/local/etc or /opt/etc directories. On Sys V machines it normally only contains configuration files for system services and password files and such. No binaries go in /etc/*. On BSD there is a mix of binaries and config files in the /etc/ directory.

On System V, you will see /sbin/ and /opt/sbin or whatever for "system admin binaries" reboot, fdisk mount and those, which on BSD lives in /etc/

As for /var/* thatis normally where system logs go. I usually put anything that grows here, and have /var/ be a mount-point for a separate disk to avoid having system logs filling up my root-disk.

How you prefer your system usually boils down to religion.

I hope I didnt add to the confusion.

Patrik
Wednesday, February 19, 2003

/usr = C:\Program Files
/home = C:\Documents and Settings
/var = *.log File Dir (C:\WINDOWS)
/etc = *.ini File Dir (C:\WINDOWS or the windows Registry)
/tmp = C:\TEMP
/bin = C:\Program Files (Application Executable Binary File)
/sbin = C:\WINDOWS and/or C:\WINDOWS\system32 (System Executable Binary File)

Although you can't exactly map one to one from *nix to Windows, the above should clear things a bit.

REF: Linux Admin-A Beginner's Guide 2nd Ed by Steve Shah.

RM
Wednesday, February 19, 2003

I'm so glad somebody asked this question because the names of the directories on *nix always confused me. 

When something has no real meaning to you, you tend to forget it.  The history lesson and mapping from Windows to Unix help a lot. 

Though, you'd think there'd be a Linux distro somewhere that has renamed these to be more human readable, since so many are into making Linux more acceptable to the average user.

Wayne
Wednesday, February 19, 2003

OK, I'll bite too. I've never known what "/. " stood for. Is it root directory?

Eunuchs for Dummies
Wednesday, February 19, 2003

Thank you everyone. I'm glad I finally asked.

PC
Wednesday, February 19, 2003

If you mean the website, /. is a joke on the way URLs are pronounced.   

http://slashdot.org would be pronounced, h.t.t.p. colon slash slash dot dot org

anon
Wednesday, February 19, 2003

Ummm...maybe H T T P colon slash slash slash dot dot org?

N Cook
Wednesday, February 19, 2003

Umm... yeah that. ;-)

anon
Wednesday, February 19, 2003

If you rename all the UNIX directories to be something "more readable", all the software will stop working.

It's amazing how everyone expects UNIX to become Windows-like for the windows generation, but when I complain about having to remember to type "dir" instead of "ls" they look at me like I'm mad.

UNIX is a different os, with different conventions. Learn the conventions and work with them rather than trying to work against them or change them, it'll be an awful lot easier.

Katie Lucas
Thursday, February 20, 2003

What about lost+found, what is that all about?

John Topley
Thursday, February 20, 2003

That's where bits of files that have somehow become "unlinked" from the rest of the filesystem go. Files are normally added to lost+found after you do a fsck (Unix equivalent of ScanDisk) and it repairs something.

A Windows equivalent would be a directory that stores the various 00001234.CHK files that come out of a ScanDisk run.

Better than being unemployed...
Thursday, February 20, 2003

I guess "man hier" will help...

Yury Hudibin
Thursday, February 20, 2003

Wayne - just create softlinks to the real directories if you have a problem remembering the real names. Its not rocket science.


Thursday, February 20, 2003

man heir

It's a bit like looking up a word in the dictionary when you have no idea how to spell that word. Has someone ever combined two of the ideas here and made a script which links everything to more friendly names?

Neil E
Thursday, February 20, 2003

Filesystem Hierarchy Standard

http://www.pathname.com/fhs/
In the document are some answers to what files should
be where in Unix/Linux.  I hope it helps.

Fredrik Svensson
Thursday, February 20, 2003

FYI, I've found that the forum at www.linuxnewbie.org has some very friendly and helpful members. You can ask the dumbest question and not get flamed. Trust me on that one.

I've been banned +500 (for life) from #linux on undernet for asking why I couldn't remount my NT share properly from samba at boot time. lol.

Ian Stallings
Thursday, February 20, 2003

Ian,

>I've been banned +500 (for life) from #linux on undernet

What a loss! Must be unbearable ;-)

Patrik
Thursday, February 20, 2003

I actually found out somewhat of an answer to that particular chicken and egg question -- there's a command "apropos" which searches a keyword database, giving a better chance of finding something without knowing its exact name.

Still, I did have to have a Unix zealot friend to tell me about it -- I would've had no idea to "man apropos" before I knew it existed. ;)

Mikayla
Thursday, February 20, 2003

It's "man hier".

"I" before "E" ...

Thanks for the idea though; I had no idea that was there.

Joe Grossberg
Friday, February 21, 2003

[What a loss! Must be unbearable ;-) ]

Yes I was deeply saddened when I was booted from that elite group. I just now started shaving and going outside and I've lost close to 100lbs ;-)

Ian Stallings
Friday, February 21, 2003

apropos == man -k.

Only problem is some Unicies (I'm looking at you, Sun, and your jerkish default installs) don't have the search database setup, so you need to run makewhatis over your man pages for it all to work.

And if you think that sounds non-obvious, you'd be right.  Fortunately other Unix/Unixlike OSes come setup out of the install.

Rodger Donaldson
Sunday, February 23, 2003

I believe "local" means your personal settings.

An application can check to see if you have any preferences, in local, before pointing back to the rest of the application in /etc or /bin folder.

bin is binaries (applications), and sbin is system binaries, but I keep forgetting about "etc", what that stands for.

Maybe "etc" is supposed to be for files that run on applications.  But then a lot of applications can run on top of other applications, like Apache on Linux, for example.

Brian R.
Wednesday, March 05, 2003

*  Recent Topics

*  Fog Creek Home