Build Linux development environment and Linux directory structure and document usage learning

Source: Internet
Author: User

The figure below is that when we open "count My Computer" in Windows, I see a letter:

Under Linux, we don't see these characters, we see folders (directories):

In the early Unix system, each manufacturer defined its own UNIX system file directory, which is rather confusing. Shortly after Linux was published, the file directory was standardized, and in 1994 the root file directory was unified, and the Linux file system hierarchy standard for FHS (filesystem hierarchy Standard) was introduced. The FHS standard sets the names and functions of the folders in the Linux root directory, unifying the naming chaos of Linux.

No matter what version of the Linux distribution, desktop, application is the cloak of Linux, file organization, directory structure is the heart of Linux.

Linux directory structure

/: root directory, general root directory only, do not store pieces,/etc,/bin, Dev,/lib,/sbin should and root directory in a partition

/bin:/usr/bin: Executable binary file directory, such as the commonly used commands ls, tar, MV, cat and so on.

/boot: Place Some of the files that are used when the Linux system starts. /boot/vmlinuz is a kernel file for Linux, as well as/boot/gurb. Separate partitions are recommended, 100M of partition size

/dev: Storage of the device files under the Linux system, access to a file in the directory, equivalent to access to a device, commonly used to mount Optical drive mount/dev/cdrom/mnt.

/ETC: The directory in which the system configuration files are stored, the executable files are not recommended for this directory, and the important profiles are/etc/inittab,/etc/fstab,/ETC/INIT.D,/etc/x11,/etc/sysconfig,/etc/ Xinetd.d remember to backup before modifying the configuration file.

Note:/etc/x11 stores settings related to x Windows.

/home: System Default User home directory, add user account, the user's home directory is stored in this directory, ~ represents the current user's home directory, ~edu represents the user Edu home directory. Suggest separate partitions and set up larger disk space for users to store data

/lib:/usr/lib:/usr/local/lib: The system uses the directory of the function library, the program in the execution process, need to call some additional parameters need function library Assistance, the more important directory for/lib/modules.

/lost+fount: When a system exception produces an error, some of the missing fragments are placed in this directory, which is usually automatically found in the appliance directory. such as loading the hard disk in/disk, this directory will automatically generate the directory/disk/lost+found

/MNT:/media: Disc default mount point, usually disc mount under/mnt/cdrom, or not, you can choose any location to mount.

/OPT: The directory where the software is installed to the host for additional installation. For example: The Fedora Community development software used by FC4, if you want to install new KDE desktop software yourself, you can install the software in this directory. In previous Linux systems, the custom was placed in the/usr/local directory

/proc: This directory of data in memory, such as system core, external devices, network status, because the data are stored in memory, so do not occupy disk space, the more important directory is/proc/cpuinfo,/proc/interrupts,/PROC/DMA,/proc /ioports,/proc/net/* and so on.

/root: System administrator Root's home directory, the system's first boot partition is/, so it is best to place the/root and/or under one partition.

/sbin:/usr/sbin:/usr/local/sbin: Place executable commands used by the system administrator, such as Fdisk, shutdown, mount, etc. Unlike/bin, these directories are commands that are used by system administrator root, which can only be "viewed" and not set up and used by the general user.

/tmp: A general user or an executing program temporarily holds a directory of files that can be accessed by anyone, and important data cannot be placed in this directory

/srv: A directory of data that needs to be accessed after the service is started, such as the Web page data that the WWW service needs to access is stored in/srv/www.

/usr: application storage directory,/usr/bin storage applications,/usr/share storage of shared data,/usr/lib storage can not run directly, but many programs are necessary to run some function library files. /usr/local: Store software upgrade packs. /usr/share/doc: System description file storage directory. /usr/share/man: Program description file storage directory, the use of man LS will query the content of/usr/share/man/man1/ls.1.gz proposed separate partitions, set larger disk space

/var: Place files that are frequently changed during the execution of the system, such as log files that change at any time/var/log,/var/log/message: All login files are stored in directories,/var/spool/mail: Mail-stored directories,/var/run: After the program or service is started, its PID is stored in the directory. Separate partitions are recommended and larger disk space is set

All documents

Linux for data files (*.mp3, *.bmp), Program Files (*.c, *.h, *.O), device files (LCD, touch screen, mouse), network files (sockets) and other management are abstract as files, using a unified approach to management.

File Category:

1) Ordinary document (data file)

Ordinary files are used to store data, programs and other information files, generally long-term storage in the external memory (disk). Normal files are divided into text files and binary files.

2) Catalog file

A catalog file is a file consisting of a directory entry that is contained in a directory in a file system.

3) Equipment files

A device file is a file that is used to provide connections to the operating system and devices. The device is handled as a file in a Linux system, and the device is manipulated like a normal file. Each device corresponds to a device file and is stored in the/dev directory.

5) Link File

Like shortcuts under Windows, Links can be divided into soft links (symbolic links) and hard links.

6) Pipeline File

Pipeline files are primarily used for a special file that passes data between processes.

7) Set of interface files

A special file used mainly for network communication between different computers.

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.