directory structure and file types for Linux

Source: Internet
Author: User

directory structure of Linux

In Linux, everything is file.

The root directory/is the most central directory in Linux, and all directories and files are under it, starting with a tree structure.


/Below are some important directories:

/boot: Store files related to system startup

/root:root User's home directory

Home directory for normal users, where each user has a home directory under their own name

/bin: Made a soft link to/usr/bin, storing the user executable file (command)

/sbin: Made a soft link to/usr/sbin, which holds the root user's executable (command)

/dev: Store device files (hardware also in the form of files)

/etc: Store configuration file

/lib,/lib64: A library file that stores the system (like a. dll file in Windows), and many commands depend on the library file

/media: Media mount directory. Default is empty

/MNT: Mount point. Default is empty

/OPT: The directory that is set up to install additional software. Default is empty

/proc: The directory in which the system process resides, is a virtual directory, and is a mapping of system memory. You can access it to get system information and process information

/run: The PID file that holds the process (same directory as/var/run)

/srv: Files that are generated when some services are started

/sys: Store files associated with the system kernel and hardware drivers

/tmp: Storage of temporary files (interval time will be automatically deleted)

/usr: Stores some files for the user. This directory is very important, will be used many times later, later installation of some services are installed into the/usr/local inside. The/usr directory includes/usr/bin,/usr/sbin,/usr/lib,/usr/lib64, and these four directories are the same as those in the previous four directories. /usr/local/also have these four directories, all of them are the same.

/var: Dynamic directory, storing periodic changes to system files, such as logs

Absolute path to the LDD command: View which library files the command depends on.


Starting with the CENTOS7 system, there are 64-bit operating systems and no 32-bit.


Tree: Lists all the contents of a directory in a hierarchical way.

If the prompt does not have this command, you need to install: Yum-y Install tree.

TREE-L Digital Catalog: Lists everything underneath this directory, with a maximum of only a few levels of directories.


Man command: View the help document for a command. (more details) (Press the Space page down, press ENTER to scroll down (in the Behavior unit), press Q to exit)

Command--help: View the help document for a command.



File types in Linux

Use Ls-l to list the details of all directories or files under the current directory. The first field represents a file type.

D: Catalog file

-: Normal file. Includes plain text files (you can view content using commands such as cat) and binary files (can only be executed to view content)

L: Soft Link file

C: Character device files, including terminal equipment and serial devices (mouse, keyboard, etc.)

B: Block file (disk drive, optical drive, etc.)

P: Pipeline file for communication between processes (limited to native processes)

S:socket (socket) file for communication between processes and processes (for process communication on different computers)


directory structure and file types for Linux

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.