|
|
Guests are welcome to view our materials. To subscribe, edit, view raw markup, etc., you'll need to register for an account. Accounts are free (and will always be free) - your involvement helps us directly and indirectly (by demonstrating that our work matters to our funders...) StartingPoints has more info.
UNIX
Unix file and directory organization
Note that there can be slight variations from one system to another.
You can read detailed information (source of most of the info on this page) about the FHS (Filesystem Hierarchy Standard) and/or FSSTND (Filesystem Standard) here:
The following sites contain further information on FHS:
Directories essential for booting: /bin, /boot, /dev, /etc, /lib, /proc, /sbin
/
[edit]
[top]
/bin
[edit]
- essential command binaries for both system administrators and regular users.
- binaries such as: bash, cp, grep, gzip, ls, tar
[top]
/boot
[edit]
- static files of the boot loader
- GRUB directory
- used for dual-boot or multi-OS boot system setups
- GRUB will load a menu if it finds the menu.lst file (used for specifying which OS's are available to boot) here:
/boot/grub/menu.lst
[top]
/dev
[edit]
[top]
/etc
[edit]
/etc is a very important directory, containing various configuration and initialization files.
- configuration files as defined by tldp: "A 'configuration file' is defined as a local file used to control the operation of a program; it must be static and cannot be an executable binary."
- configuration files found in this directory for programs such as: Apache, cron, rpm, yum, ssh, etc.
- some interesting sub-directories in /etc:
- some interesting files in /etc:
-
/etc/bashrc system wide functions and aliases, determines the behavior of interactive shells
-
/etc/crontab cron configuration file
-
/etc/csh.cshrc csh configuration for all shell invocations
-
/etc/groups like /etc/passwd but for groups
-
/etc/inittab describes how the INIT process should set up the system in a certain run level
-
/etc/issue getty output prior to the login prompt - i.e. the system welcome message
-
/etc/mime.types listing of mime types and related extensions
-
/etc/motd "message of the day" - output message immediately after a successful login
-
/etc/passwd user database file with fields for username, home directory, other info for each user
-
/etc/php.ini php behavior settings file
-
/etc/profile system wide environment and startup programs
-
/etc/resolv.conf lists nameservers to use for host lookups
-
/etc/rsyslog.conf the main configuration file for the rsyslogd daemon which logs system messages - see man rsyslogd for more info
-
/etc/securetty identifies secure terminals from which root is allowed to log in. TLDP recommends that only virtual consoles are listed so that it is more difficult to gain root access via modem or network access.
-
/etc/shadow encrypted file which holds user passwords
-
/etc/shells list of trusted shells
-
/etc/services listing of internet services and ports used for each (i.e. ssh, http, ftp, etc.)
-
/etc/sudoers the sudoers file - lists users who can use sudo. See man sudoers for more info.
[top]
/home
[edit]
- user directories (but not root - see /root )
[top]
/lib
[edit]
- shared library images (C code library) needed to boot the system and run commands in the root filesystem (eg. /sbin and /bin)
- kernel modules
/lib/modules
[top]
/lost+found
[edit]
- contains any recovered files after a system crash or power failure
[top]
/media
[edit]
- contains mount points for removable media (i.e. floppy, cdrom, etc.)
[top]
/misc
[edit]
[top]
/mnt
[edit]
- generic mount point where one can mount filesystems and/or devices
[top]
/net
[edit]
[top]
/opt
[edit]
- optional packages not part of default installation (applications like office, etc.) according to the 2004 standard. Our experience is that we see it rarely used.
[top]
/proc
[edit]
- files that provide status and statistics on system, kernel, and processes
- it is a pseudo-filesystem which is used as an interface to kernel data structures
- each running process has a directory in
/proc that corresponds to it's PID from which you can extract info about the process - see man proc for more info
[top]
/root
[edit]
[top]
/sbin
[edit]
- system programs (for system administration, etc.)
- FSSTND states
/sbin should contain only binaries essential for booting, restoring, recovering and/or repairing the system in addition to the binaries in /bin
- programs like: service, ip, init, chkconfig
- some "less important" system/admin programs can be found in
/usr/sbin
- locally installed system admin programs should be placed in
/usr/local/sbin
[top]
/selinux
[edit]
[top]
/srv
[edit]
[top]
/sys
[edit]
[top]
/tmp
[edit]
- temporary files
- files in this directory should not be assumed to survive a restart or even invocations of any program
[top]
/usr
[edit]
- contains all user binaries, their documentation, libraries, header files, etc. - contains only static data (as opposed to
/var which contains variable data)
- some interesting subdirectories in
/usr :
-
/usr/bin contains most binaries on the system (i.e. diff, emacs, gzip, g++, svn, etc.)
-
/usr/include header files for C programming language and header files used by various programs on the system
-
/usr/lib program libraries (collections of frequently used routines) - library of unchanging data files for programs
-
/usr/local locally installed software - reserved for the use of the local admin(s).
-
/usr/sbin system admin commands not needed on the root filesystem (i.e. most server programs such as: chrond, httpd, sshd, etc.)
-
/usr/share/doc miscellaneous documentation files
-
/usr/share/info GNU info documents
-
/usr/share/man manual pages
-
/usr/src a linux or Redhat or some such similar subdirectory contains the Linux kernel source, header files and docs
-
/usr/X11R6 files for the X Window System
[top]
var
[edit]
- variable data dynamic files, such as: system log files, mail/printer spool directories, etc.
- some interesting subdirectories or files:
-
/var/cache cached data from applications (usually stored from time-consuming I/O or calculations)
-
/var/lib application dynamic data libraries/files
-
/var/local variable data for local programs installed in /usr/local
-
/var/lock lock files for devices being used by a program
-
/var/log log files
-
/var/log/auth.log record of all logins and logouts by users and system processes
-
/var/log/btmp log of all attempted bad logins to the system (use lastb command)
-
/var/log/cron cron messages
-
/var/log/httpd apache server messages
-
/var/log/httpd/access_log log of accesses to the apache server
-
/var/log/httpd/error_log log of errors, very useful for debugging server operation
-
/var/log/httpd/rewrite_log helpful with debuggin mod_rewrite issues
-
/var/log/httpd/ssl_access_log
-
/var/log/httpd/ssl_error_log
-
/var/log/httpd/ssl_rewrite_log
-
/var/log/messages system logs
-
/var/mail user mailbox files
-
/var/named database for BIND (Berkeley Internet Name Domain), an Internet domain name server
-
/var/opt data of application installed in /opt (i.e. optional packages not part of the default installation)
-
/var/spool spool files for mail, news, printing (lpd), etc.
-
/var/tmp temporary files - can be held for longer period of time than in /tmp
-
/var/log/wtmp log of all users who logged into and out of the system (use last command)
-
/var/yp database for NIS (Network Information Services)
[top]
-- RobertSajan - 20 May 2008
|
|