4.1 Directory structure Features
1, all the directory of Linux is a hierarchical, inverted tree-like structure , all directories start with the root directory "/".
2. different directory data can span different disk partitions and different disk devices
3. all catalogs are organized and named according to certain categories
4, the Linux system default device is not accessible, must be hung in the existing directory structure system.
5, Mount is to give the device a access to the entrance, which is called the mount point . The mount point must be an absolute path.
6. Mount disk device: Mount; unmount disk device: Umount
7, through the df-h command can view the disk partition situation
[Email protected] ~]# df-h
Filesystem Size used Avail use% mounted on
/dev/sda3 6.9G 1.5G 5.1G 23%/
Tmpfs 238M 0 238M 0%/dev/shm
/DEV/SDA1 190M 36M 145M 20%/boot
8. The partition of the system is automatically mounted via/etc/fstab file boot.
4.2 The meaning of the first level directory
| Directory |
File contents to be placed
|
| / |
root directory, all directory structures of the Linux file system start from the root directory |
| /bin |
Binary commands that can be executed in single-user mode for all users |
| /sbin |
Binary commands that can only be executed by super Administrator root |
/boot
|
directory where the boot loader is installed |
| /dev |
directory where device files are stored |
| /etc |
System configuration files and service profiles |
| /home |
Home directory for ordinary users |
| /lib |
Directories in which shared libraries and kernel modules reside |
/lost+found
|
When the system suddenly shuts down or crashes, files that have not yet been saved will be placed in this directory. The fsck command restores the data during boot and the data that cannot be recovered is deleted. |
/mnt
|
Mount directory that mounts temporary storage devices
|
| /opt |
installation directory for third-party software |
/proc
|
Virtual file system for kernel and process store information |
/selinux
|
Location of SELinux file storage |
| /srv |
Site-specific data, provided by the system |
| /sys |
Real-time information about the system kernel and drivers |
/tmp
|
Temporary files. Data is not retained during system restart |
| / usr |
A file or directory related to a system user, such as an application and associated library files. /usr/local placing user-installed programs
|
| /var |
During the normal operation of the system, the contents of the file are constantly changing. |
4.3/etc Sub-directory meaning
| Directory |
The contents of the file to be placed |
| /etc/sysconfig/network-scripts/ifcfg-eth0 |
NIC configuration file |
| /etc/resolv.conf |
DNS Client configuration file |
| /etc/hosts |
Local domain name resolution file, equivalent to DNS |
| /etc/sysconfig/network |
Gateway and Host name configuration
|
| /etc/fstab |
Automatically mount files on boot, all disk partitions will be automatically mounted on boot
|
| /etc/inittab |
System initialization configuration file |
| /etc/issue |
Default output kernel version information
|
| /etc/skel/ |
When you create a normal user account, the directory is copied to your home directory |
/etc/sudoers
|
Configuration files related to the sudo command |
| /etc/profile |
Global environment variable configuration file |
| /etc/bashrc |
Global environment variable configuration file |
| /etc/syslog.conf |
System Log Parameter Configuration |
4.4/USR Directory
| Directory |
Configuration files that should be placed |
/usr/bin
|
Non-essential executable file for all users
|
| /usr/sbin |
System commands required for non-system uptime
|
| /usr/lib |
Libraries for binary files in/usr/bin and/usr/sbin |
/usr/local
|
Place the user's local Setup program |
4.5/var Directory
| Directory |
Configuration files that should be placed |
| /var/log/mesages |
System log information, poll by week |
| /var/log/secure |
system security log that logs information about the login system. Whether the login succeeds or the login fails, it will be recorded. |
| /var/spool/cron/root |
Timer configuration file Directory |
| /var/spool/clientmqueue |
When the mail service is not turned on, all messages sent to the mail administrator are placed here |
| /var/spool/mail |
Mail directory |
4.6/proc Directory
| Directory |
Configuration files that should be placed |
| /proc/meminfo |
Memory information |
| /proc/cpuinfo |
View CPU Information |
| /proc/loadavg |
Viewing average load information |
/proc/mounts
|
Mount the information in detail when with df-h |
4.7/dev Directory
| Directory |
Configuration files that should be placed |
| /dev/zero |
Unlimited ASCII 0 |
| /dev/null |
Data black hole |
| /dev/cdrom |
Connection file, connecting to/dev/sr0 |
This article from "Wang continued" blog, declined reprint!
Lesson 4 directory Structure