Whenever I see unix tutorials, I see them using:
/var/...
is var just a placeholder for an example?
No. /var
is a directory. It tends to contains "variable" data - that is data that is going to tend to change and often not configuration files. (eg. /var/mail
for mail storage, /var/vm
for where virtual memory is stored)
For more information on how directories are laid out on Unix check out question 24523
No, /var
is a directory in the filesystem. One of the directories often referred to that exists under that is /var/log
where most of the system and many of the application logs are kept.
"foo", "bar", "baz" and the like are placeholders.
The top-level unix directory names are largely influenced by how these systems were configured decades ago. Here's a quick run-down of the more common ones:
/bin
, but should only be run by root.Traditionally, /usr
was actually mounted as a network filesystem once the system was operational. So /bin
and /sbin
(which were stored on the local machine) only contained the stuff necessary to get that remote access up and running. /usr/
in turn contains elements of the "standard" directory tree, including /usr/bin/
, /usr/sbin/
, /usr/lib/
, /usr/etc/
, etc.
In the same way, /usr/local/
contained a set of programs, files, etc., that were "local" to a given installation, i.e. not part of the standard distribution. Again, expect to see /usr/local/bin/
, /usr/local/lib/
, etc. On a newly installed machine, those directories should be relatively empty, and it's a pretty safe place to install your own programs without creating any conflicts with the base system.
Traditionally, /tmp/
was erased upon boot, so stuff put there shoudn't need to stick around. /var/
on the other hand, contains a more permanant storage area. Things that end up under /var/
include database files, log files, and mail boxes.
If all the packages on your system are well-behaved, you should be able to put the entire system on read-only media (such as a CD), except have /var/
(and maybe /home/
) be on a writable device, and /tmp/
be a ramdrive.