Monday, May 17, 2010

Linux 常见目录

The Linux file system has a well-defined set of top-level directories,and some of these directories have specific purposes.

Top-level Direcotries in Linux File System

DirectoryDescription
/This root directory forms the base of the file system.All files and directories are contained logically in the root directory,regardless of their physical locations.
/binContains the executable programs that are part of the Linux operating system. Many Linux commands, such as cat, cp, ls, more, and tar, are located in /bin.
/bootContains the Linux kernel and other files that the LILO and GRUB boot managers need. (The kernel and other files can be anywhere, but placing them in the /boot directory is customary.
/devContains special files that represent devices attached to the system.
/etcContains most system configuratoin files and the initialization scripts(in the /etc/tc.d subdirectory)
/homeConverntional location of the home directories of all users. User edulaney's home directory, for example, is /home/edulaney.
/libContains library files for all programs stored in /sbin and /bin directories (including the loadable driver modules) needed to start Linux.
/lost+foundDirectory for lost files. Every disk partition has a lost+found directory.
/mediaA directory for mounting file systems on removable media, such as CD/DVD-ROM drives, floppy disks, and Zip drives. Contains the /media/floppy directory for mounting floppy disks and /media/cdroom or /media/cdroom0 directory for mounting the CD/DVD-ROM drive. if you have a CD/DVD recorder, you find a /media/cdrecorder directory instead of /media/cdrom and may also find /media/DVD.
/mntA directory for temporarily mounted file systems
/optProvides a storage area for large application software packages. For example, some distributions install the OpenOffice.org Office suite in the /opt directory.
/procA speical directory that contains various information about the processes running in the Linux system.
/rootThe home directory for root user.
/sbinContains executable files representing commands typically used for system-administration tasks and used by the root user. Commands such as halt and shutdown reside in the /sbin directory.
/srvContains data for services( such as Web and FTP ) offered by this system.
/sysA special directory that contains information about the devices, as seen by the Linux kernel.
/tmpA temporary directory that any user can use as a scratch directory, meaning that the contents of this directory are considered unimportant and usually are deleted every time the system boots.
/usrContains the subdirectories for many important programs, such as the X Window System( in the /usr/X11R6 directory ) and the online manual.
/varContains various system files(such as logs), as well as directories for holding other information, such as files for the Web server and anonymous FTP server.

Important /usr Subdirectories
SubdirectoryDescription
/usr/X11R6Contains the X Window System software
/usr/binContains executable files for many more Linux commands,including utility programs that are commonly available in Linux but aren't part of the core Linux operating system.
/usr/gamesContains some old Linux games
/usr/includeContains the header files (file names ending in .h) for the C and C++ programming languages; also includes the X11 header files in the /usr/include/X11 directory and the Linux kernel header files in the /usr/include/linux directory.
/usr/libContains the libraries for C and C++ programming languages; also contains many other libraries, such as database libraries and graphical libraries.
/usr/localContains local files. The /usr/local/bin directory, for example, is supposed to be the location for any executable program developed on your system
/usr/sbinContains many administrative commands, such as commands for electronic mail and networking.
/usr/shareContains shared data, such as default configuration files and images for many applications. For example, /usr/share/gnome contains various shared files for the GNOME desktop, and /usr/share/doc has the documentation files for many Linux applicaions (such as the bash shell, the Sawfish window manager, and The GIMP image-processing program).
/usr/share/manContains the online manual (which you can read by using the man command)
/usr/srcContains the source code for the Linux kernel (the core operating system)


Important /var Subdirectories
SubdirectoryDescription
/var/cacheStorage area for cached data for applications
/var/libContains information relating to the current state of applications
/var/lockContains locked files to ensure that a resource is used by one application only
/var/logContains log files organized into subdirectories. The syslogd server stores its log files in /var/log, with the exact content of the files depending on the syslogd configuration file /etc/syslog.conf. For example, /var/log/messages is the main system log file; /var/log/secure contains log messages from secure services (such as sshd and xinetd); and /var/log/mainlog contains the log of mail messages.
/var/mailContains user mailbox files
/var/optContains variable date for packages stored in /opt directory
/var/runContains data describing the system since it was booted
/var/spoolContains data that's waiting for some kind of processing
/var/tmpContains temporary files preserved between system reboots
/var/ypContains Network information Service(NIS) database files

No comments:

Search This Blog