Linux Learning CentOS (iv)----Linux directory Introduction

Source: Internet
Author: User

Statement

Welcome reprint, but please keep the original source of the article →_→

Life One number: http://www.cnblogs.com/smyhvae/

Article Source: http://www.cnblogs.com/smyhvae/p/3932598.html

Contact information: [Email protected]

Body

When we lose the Linux command, we often have to go into a directory to operate, so it is very important to understand the meaning of these directories, the following is a detailed introduction. Although I can't remember it all at once, it can be easily consulted as a dictionary.

One, the role of Linux directories:

Directory Name

Directory role

/bin/

The directory where the system commands are stored, which can be performed by both Ordinary and super users . However, commands placed under/bin can also be executed in single-user mode

/sbin/

Save the commands associated with the system environment settings, only the superuser can use these commands for system environment settings, but some commands can allow normal users to view

/usr/bin/

The directory where the system commands are stored, which can be performed by both Ordinary and super users . These commands are not related to system boot and cannot be performed in single-user mode

/usr/sbin/

Storing root file system unnecessary system administration commands, such as most service programs. only super users can use it. You can actually notice the Linux system, the commands saved in all "Sbin" directories are available only to Superuser, and the commands saved in the "bin" directory are available to all users

Most of the commands in Linux are placed in the top four directories. All of the commands in Linux are executable binary (binary) binaries.

"S" in "/sbin/" means that this command can only be performed by the root user.

"/usr/bin/" means that this command cannot be performed under a single user (USR is similar to safe mode in Windows, starting the smallest service, mainly for repair use).

directory name

directory function

/boot/

System start directory , save system startup-related files such as kernel files and boot bootstrapper

(grub) files, etc.

/dev/

device file save location. We've said that everything in Linux is saved as files, including hardware. Then this directory is the

/etc/

"/ td>

profile save location. All configuration files in the system that use the default installation (RPM installation) are stored in this directory, such as user accounts and passwords, service startup scripts, common service profiles, etc.

The third refers to the system default configuration file to save the directory.

/lost+found/

directory name

directory function

/home/

The home directory for normal users. When each user is established, each user has a default login location, which is the home directory of the user, and the home directory for all ordinary users is the same directory as the

User name under//. such as the user User1 home directory is/home/user1

/lib/

system call Save location

When the system crashes unexpectedly or the machine shuts down unexpectedly, some file fragments are placed here. When the system starts, the Fsck tool checks here and repairs the corrupted file system. This directory only appears in each partition, for example,/lost+found is the root partition of the backup recovery directory,/boot/lost+found is the/boot partition backup Recovery directory

The home directory of the normal user is in the/home/user level two directory, while the super user's home directory exists directly in the/root directory.

In fact, each partition has its own/lost+found/directory.

Directory Name

Directory role

/media/

Mount the directory. System recommendations are used to mount media devices, such as floppy disks and discs

/mnt/

Mount Directory, there is only one mount directory in early Linux, and there is no subdivision. Now this directory system is recommended to mount additional devices such as USB flash drives, mobile hard disks and other operating system partitions

/misc/

Mount the directory. The system recommends a shared directory to mount the NFS service. We have just explained that hanging children's shoes should be known as a mount point as long as an empty directory has been created. Then the system prepared three default mount directories/media,/mnt,/misc, but in which directory to mount what device can be determined by the administrator. For example, when the elder brother contact Linux, the default mount directory only/mnt one, so developed in the/mnt under the different directory to mount different devices of the habit. Such as

/mnt/cdrom Mount CD,/mnt/usb mount USB stick, this is all possible

/opt/

The software where the third-party installation is saved. This directory is where other software is placed and installed, I manually installed the source package software can be installed into this directory. But I'm still more used to the software

In the/usr/local/directory, which means that the/usr/local/directory can also be used to install the software

The above three directories are the mount directories specifically provided by the system (you can compare mount points to disk characters). The default is empty because only empty directories can be used as mount points for mounted devices.

Of course, you can re-create the device's mount point yourself without these three directories.

Directory Name

Directory role

/proc/

Virtual file system, the data in this directory is not saved to the hard disk, but stored in memory. The main storage system is the kernel, process, external device status and network status lights. Such as

/proc/cpuinfo is to save the CPU information,/proc/devices is to save the device driver list,/proc/filesystems is to save the file system list,/proc/net/is to save the network protocol information

/sys/

Virtual file system. Similar to the/proc directory, are stored in memory, mainly stored in the kernel-related information

These two directories are stored in memory, and it is recommended that you do not write files to these two directories because the restart is not valid.

/proc/is the process, the current system is running information, while storing some hardware information, such as CPU parameters.

Directory Name

Directory role

/root/

Home directory for super users. Ordinary user home directory under "/home", Super for the family directory directly under the "/"

/srv/

Service Data Catalog. After some system services are started, you can save the required data in this directory

/tmp/

Temp directory. The directory where the system holds temporary files that all users can access and write to. We recommend that you not save important data in this directory, preferably by emptying the directory every time you boot

/usr/

System software Resource directory. Note that USR is not a user abbreviation, but rather a "Unix softwre Resource" abbreviation, so it is not the data that is stored, but the directory where the system software resources are stored. Most of the software installed in the system is saved here, so in addition to the/usr/bin/and/usr/sbin/, I'm introducing a few/usr/under the two level directory

/var/

The location where the dynamic data is saved. Mainly save the cache, log and files generated by the software

The files in the/tmp/can be emptied. Beginners are advised to do exercises in the home directory or in the/tmp/directory.

/usr/Storage System Resource directory. Similar to the/windows directory under Windows.

Second, server considerations:

    • Remote server does not allow shutdown, only reboot
    • Services should be turned off when restarting
    • Do not run high load commands at peak server access
    • Do not kick yourself out of the server when configuring the firewall remotely
    • Specify a reasonable password specification and update it regularly
    • Reasonable allocation of permissions
    • Regularly back up important data and logs

Linux Learning CentOS (iv)----Linux directory Introduction

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.