Penguin
Blame: FileSystemHierarchy
EditPageHistoryDiffInfoLikePages
Annotated edit history of FileSystemHierarchy version 16, including all changes. View license author blame.
Rev Author # Line
14 AristotlePagaltzis 1 In [Unix]/[Linux], there is nothing like the registry or some other kind of magic database. It's all just files. Understanding the FileSystem and learning what goes where, roughly, is an important step in finding your way around your system.
2
3 The following is a list of the conventional locations for the most common things.
1 AristotlePagaltzis 4
10 AristotlePagaltzis 5 __<tt>/</tt>__:
13 AristotlePagaltzis 6 The FileSystem root where all of the directory tree "grows out of."
7
10 AristotlePagaltzis 8 __<tt>/boot</tt>__:
16 AristotlePagaltzis 9 The [Kernel] goes here. This is often a separate [Partition] at the beginning of the HardDisk.
13 AristotlePagaltzis 10
10 AristotlePagaltzis 11 __<tt>/bin</tt>__:
13 AristotlePagaltzis 12 System executable files for use by all users.
13
10 AristotlePagaltzis 14 __<tt>/dev</tt>__:
13 AristotlePagaltzis 15 Device nodes, ie files that represent your computer's periphery.
16
10 AristotlePagaltzis 17 __<tt>/etc</tt>__:
13 AristotlePagaltzis 18 Configuration files.
19
10 AristotlePagaltzis 20 __<tt>/home</tt>__:
13 AristotlePagaltzis 21 Every user owns a subdirectory named for his username here. Your own subdirectory is where you store all your personal stuff that has nothing to do with the system. It is aptly called your home. Your mail, your pictures and letters, your music, the videos and your notes, this is where you put them. When you configure a program, it saves the settings here, in so-called DotFile~s.
22
23 Instead of <tt>/home/''yourusername''</tt> you commonly simply say <tt>~~</tt>.
24
10 AristotlePagaltzis 25 __<tt>/lib</tt>__:
13 AristotlePagaltzis 26 Libraries needed to run the programs in <tt>/bin</tt> and <tt>/sbin</tt>.
27
10 AristotlePagaltzis 28 __<tt>/mnt</tt>__:
13 AristotlePagaltzis 29 MountPoint for temporary FileSystem~s (eg [CDROM], FloppyDisk).
15 IanMcDonald 30
31 __<tt>/media</tt>__:
32 MountPoint for temporary FileSystem~s that FedoraCore uses in latest versions (eg [CDROM], [DVD]).
13 AristotlePagaltzis 33
10 AristotlePagaltzis 34 __<tt>/opt</tt>__:
12 AristotlePagaltzis 35 Intended for additional, self-contained software packages in subdirectories, such as TarBall~s which contain binaries rather than source. [KDE] is often found in <tt>/opt/kde</tt>, even though it doesn't fit the "self-contained" criterion. Some people install source TarBall~s in here too, especially beta software.
13 AristotlePagaltzis 36
10 AristotlePagaltzis 37 __<tt>/proc</tt>__:
13 AristotlePagaltzis 38 A virtual FileSystem containing pseudofiles with information about running processes. On [Linux], there are also many files pertaining to the hardware and [Kernel] configuration.
39
10 AristotlePagaltzis 40 __<tt>/root</tt>__:
13 AristotlePagaltzis 41 Home directory of <tt>root</tt>, the SuperUser.
42
10 AristotlePagaltzis 43 __<tt>/sbin</tt>__:
13 AristotlePagaltzis 44 Executable files only of interest to <tt>root</tt>, the SuperUser.
45
10 AristotlePagaltzis 46 __<tt>/usr</tt>__:
13 AristotlePagaltzis 47 The place for files shared by all users of the machine. The party is here.
48
49 You will find duplicates for a number of directories at the root level, such as <tt>/usr/bin</tt>, <tt>/usr/lib</tt>, <tt>/usr/sbin</tt> etc which are analogous to <tt>/bin</tt>, <tt>lib</tt>, <tt>/sbin</tt> etc. The distinction is somewhat arbitrary; it comes from the fact that <tt>/usr</tt> is commonly on a [Partition] by itself, which means the programs and other miscellanea found under it are not available during the early boot process.
50
51 There's also a <tt>/usr/share</tt> which has no counterpart at the root level. It is where program resources are installed; things like icons, helpfiles, sound clips and such end up here.
52
53 Most things you install sprinkle their files over these directories.
54
10 AristotlePagaltzis 55 __<tt>/usr/local</tt>__:
13 AristotlePagaltzis 56 Anything shared across the system but not supplied by the system vendor traditionally goes here -- most commonly, [Package]s compiled from TarBall~s.
57
10 AristotlePagaltzis 58 __<tt>/var</tt>__:
13 AristotlePagaltzis 59 Variable data files, such as logs, mailboxen, printer spools, cached data, databases and the like. Things that will change, but which need to be remembered across invocations of a program. Scratch space, if you will.
60
10 AristotlePagaltzis 61 __<tt>/tmp</tt>__:
14 AristotlePagaltzis 62 The place for temporary files -- that is, ''literally'' temporary files. On some systems this directory is frequently purged, and on machines with modern [Linux] kernels it may be mounted as [Tmpfs] FileSystem that exists only in memory. When VirtualMemory subsystems were not as good as they are today, many userland programs had to explicitly balance memory and disk consumption in <tt>/tmp</tt>, and some still do.
63
64 The other part that's important to remember are EnvironmentVariable~s, many of which are dedicated to telling applications where they should look for certain kinds of files. The most notable example would be <tt>PATH</tt>, which specifies which directories programs can be found in.
65
66 Note that all of these choices are arbitrary. You could put anything anywhere at all, as long as you have write permissions, and still make things work, though only someone who enjoys headaches would do that. The important lesson in the arbitrariness is that, again, there is nothing magical about any of this. They are social conventions, not mechanical necessities. A [Unix] system is ultimately just a bunch of files and a handful of processes.
1 AristotlePagaltzis 67
13 AristotlePagaltzis 68 See also:
69 * hier(7)
70 * [Filesystem hierarchy standard | http://www.pathname.com/fhs/]
3 AristotlePagaltzis 71
72 ----
73 CategoryBeginners

PHP Warning

lib/blame.php:177: Warning: Invalid argument supplied for foreach()