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?
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?
"/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.
/var
, as the name implies, is for variable (read/write) data that's persistent across reboots (unlike temporary data in /tmp
), in contrast with the (mostly) read-only /usr
. As for /var/lib
, in this particular case the lib
subdir means "library" only in a very broad sense, as it actually stands for any specific software or package, as opposed to more general, system-wide subdirs like /var/log
which don't belong to any particular package. MySQL example, its read-only files go to /usr/*/mysql
, settings at /etc/mysql
, and read/write databases at /var/lib/mysql
Jun 11, 2023 at 10:26
The /etc/
directory is a common location to put configuration files. (But not the ONLY one by any means.)
The /var
directory is the location for "variable" things like logs, running process ID pointer files, spool directories, and other things important for running services.
The /usr/
directory is where user-accessible applications are generally located. Also a case of "by no means all".