major directories (UNIX and Linux) (original) (raw)


music

| OSdata.com: programming text book | | OSdata.com | | ---------------------------------------------------------------------------------------------- | | ---------- |

summary

This subchapter looks at some of the major directories (folders) on UNIX/Linux/Mac OS X.

major directories

This subchapter looks at some of the major directories (folders) on UNIX/Linux/Mac OS X.

directory listing

The following is a brief description of some of the major directories. Not all systems will have all of these directories.

/ The root directory of the entire file system.

/Applications On Mac OS X, this is the location of the Macintosh programs.

/Applications/Utilities On Mac OS X, this is the location of the graphic user interface based utility programs.

/bin A collection of binary files, better known as programs. These are the programs needed by the operating system that normal users might use. Many of the standard system commands are stored here. Contrast with /sbin below.

/boot or /kernel The files needed to boot or start your computer. Includes the bootstrap loader, the very first thing loaded when your computer starts. On Linux, it usually includes the Linux kernel in the compressed file vmlinuz.

/dev The devices connected to your computer (remember, everything, even hardware devices, is treated as a file in UNIX or Linux). Examples are the keyboard, disks, and printers.

/etc System-wide configuration files, startup procedures, and shutdown procedures.

/home or /users The home directories for each user. Contains such things as user settings, customization files, documents, data, mail, and caches. The contents of this directory should be preserved during operating system updates or upgrades.

Every new user account starts with a few basic files such as .login, .cshrc, and .profile. A system administrator may want to add additional customization such as an introductory README file.

/lib or /Library Shared library files and kernel modules.

/lost+found Files recovered during filesystem repair.

/mnt Mount points for removable media (floppy disks, CD-ROM, Zip drives, etc.), partitions for other operating systems, network shares, and anything else temporarily mounted to the file system. Linux and UNIX don’t use Windows-style drive letters.

/net Other networked systems (again, treated as files).

/opt Optional large applications and third party software. In older systems this might be /usr/local.

/private On Mac OS X, this is the location of the UNIX files. It is normally kept hidden from all users in Finder, but is visible in your terminal emulator and shell. Mac OS X has links to the major UNIX directories at the root level so that UNIX and Linux tools can find their files in the standard locations.

/proc A Linux-only directory. Information about processes and devices. The files are illusionary. The files don’t exist on the disk, but are actually stored in memory. Many Linux utilities derive their information from these files.

/sbin System binaries (that is, system programs). These are programs that general users don’t normally use (although they can). This directory is not in the PATH for general users. Contrast with /bin listed above.

/root The home directory for the system administrator (superuser or root).

/tmp Space for temporary files. Required by all forms of UNIX. This directory may automatically be cleaned on a regular basis. This directory is normally erased on bootup.

/usr User binaries (programs), libraries, manuals, and documentation (docs). Common subdirectories include online help (/usr/share), header files for application development (/usr/include), and system configuartion files related to low-level hardware (such as /usr/cpu and /usr/gfx).

/var Files that change, such as spool directories, log files, lock files, temporary files, and formatted (on use) manual pages. Some common subdirectories include X Windows files (/var/X11), system services files, applications related files (/var/netscape), system administration files and data (/var/adm or /var/spool), a second temporary directory (/var/tmp) that is not normally erased on bootup.

Swap Virtual memory on a hard drive. Allows the memory manager to swap some data and program segments to hard drive to expand the amount of memory available beyond the limits of physical memory.


comments, suggestions, corrections, criticisms

free music player coding example

Coding example: I am making heavily documented and explained open source code for a method to play music for free — almost any song, no subscription fees, no download costs, no advertisements, all completely legal. This is done by building a front-end to YouTube (which checks the copyright permissions for you).

View music player in action: www.musicinpublic.com/.

Create your own copy from the original source code/ (presented for learning programming).

Because I no longer have the computer and software to make PDFs, the book is available as an HTML file, which you can convert into a PDF.

UNIX used as a generic term unless specifically used as a trademark (such as in the phrase “UNIX certified”). UNIX is a registered trademark in the United States and other countries, licensed exclusively through X/Open Company Ltd.