Wednesday, July 3, 2013

dirhelp - understanding Linux's Filesystem Hierarchy Structure

A while back I created a command line utility to help with learning the linux filesystem hierarchy structure (FHS), it's called dirhelp.

Here is some example usage:

jrenner@main:/$ dirhelp
[/] Primary hierarchy root and root directory of the entire file system hierarchy.
jrenner@main:/$ dirhelp opt
[/opt] Optional application software packages.
jrenner@main:/$ cd /var/log
jrenner@main:/var/log$ dirhelp
[/var/log] Log files. Various logs.
jrenner@main:/var/log$ dirhelp /usr/share
[/usr/share] Architecture-independent (shared) data. This directory contains subdirectories with specific application data, that can be shared among different architectures of the same OS.  Often one finds stuff here  that  used  to live in /usr/doc or /usr/lib or /usr/man.
jrenner@main:/var/log$ dirhelp /usr/local
[/usr/local] Tertiary hierarchy for local data, specific to this host. Typically has further subdirectories, e.g., bin/, lib/, share/.
jrenner@main:/var/log$ cd /usr
jrenner@main:/usr$ dirhelp *
'/usr/games' - no information found
'/usr/lib32' - no information found
[/usr/bin] Non-essential command binaries (not needed in single user mode); for all users.
[/usr/include] Standard include files for the C compiler.
[/usr/lib] Libraries for the binaries in /usr/bin/ and /usr/sbin/.
[/usr/local] Tertiary hierarchy for local data, specific to this host. Typically has further subdirectories, e.g., bin/, lib/, share/.
[/usr/sbin] Non-essential system binaries, e.g., daemons for various network-services.
[/usr/share] Architecture-independent (shared) data. This directory contains subdirectories with specific application data, that can be shared among different architectures of the same OS.  Often one finds stuff here  that  used  to live in /usr/doc or /usr/lib or /usr/man.
[/usr/src] Source code, e.g., the kernel source code with its header files.
[/usr/X11R6] X Window System, Version 11, Release 6.