Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Possible Duplicate:
Meaning of directories on Unix and Unix like systems

I'm confused about the different uses for 3 of the standard "root-level" folders: /var /etc /usr

What are the different use cases for these directories?

share|improve this question

marked as duplicate by Murali Suriar, Wesley, EEAA, Mark Henderson Apr 30 '12 at 4:52

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers 2

"/etc" is used for configurations (.conf files etc). here you find all the configs and settings for your system.

"/usr" is used for "user programs". Usually your package manager installs all the binaries, shared files etc. from all programs here (except config files, which go to /etc). You can check /usr/bin for binaries, /usr/share for shared files (media, etc), /usr/share/doc for documentation,...

There is also an "/opt" folder, where there are "other" programs usually put (mostly binary programs, or programs installed from other sources (not the default package manager). Some programs like that (usually compiled) also go to "/usr/local"

"/var" is usually used for log files, 'temporary' files (like mail spool, printer spool, etc), databases, and all other data not tied to a specific user. Logs are usually in "/var/log", databases in "/var/lib" (mysql - "/var/lib/mysql"), etc.

share|improve this answer

The /etc/ directory is a common location (but not ONLY any means) to put configuration files.

The /var directory is the location for "variable" things like logs, running process ID pointer, spool directories, and other things important for running services.

The /usr/ directory is where user-accessible application are generally location. Also a case of "by no means all".

share|improve this answer
    
So what would the definition of /usr/etc be? –  Robert Ross Apr 29 '12 at 23:21
    
config files for user-supplied application, probably. Personally, I prefer to keep THOSE things over in /opt if they're not part of a package provided with the OS or Distribution. –  Magellan Apr 29 '12 at 23:27
    
Mind you, none of this is a "rule". It's more tradition and convention and it's transgressed often enough in practice, but is generally-considered a good idea to follow. –  Magellan Apr 29 '12 at 23:27
    
Right, that's more what I'm aiming towards is best practices. Perhaps a title change? –  Robert Ross Apr 29 '12 at 23:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.