Linux file directory

Source: Internet
Author: User
Tags lowercase printable characters temporary file storage uppercase letter

Linux as a basic operating system, it should have a lot of functions, here we simply talk about the function of file management.


1. The meaning of the file directory:

/boot: Boot file directory, kernel file (vmlinuz), boot loader (bootloader,grub) are stored in this directory

/bin: A basic command for all users; The program binaries that are used when OS startup is not associated to a separate partition

/sbin: The basic command of the management class; cannot be associated to a standalone partition, the program-managed binaries that are used by OS startup

/lib: Basic shared library files that the program relies on at startup and kernel module files (/lib/modules)

/LIB64: storage location for secondary shared library files dedicated to x86_64 systems

/etc: Configuration file directory Miscellaneous

/home/username: Normal User home directory

/root: Administrator's home directory

/media: Portable mobile device mount point

/MNT: Temporary file system mount point

/dev: Device files and special file storage locations

B:block device, (block device) physically present random access

C:character device, (character device) logically exists without cached linear access

D: Folder

/OPT: Where to install third-party applications

/SRV: Data used by services running on the system

/tmp: Temporary file storage location

/usr: applications, files, etc.

/proc: In-memory tasks, including some processes, etc.

/sys Hardware Status

/run system operation) CENTOS6


2. The file name in Linux has a maximum of 255 bytes, and the different colors of the file name correspond to the meaning, also different. For example:

Blue--and catalog Green--Executable file red--Zip file light blue--Link file gray--Other files pink--->sock file

Xxx--> Hardware Devices

Components of the application on 3.Linux:

Binaries:/bin,/sbin,/usr/bin,/usr/sbin,/usr/local/bin,/usr/local/sbin

Library files:/lib,/lib64,/usr/lib,/usr/lib64,/usr/local/lib,/usr/local/lib64

Configuration files:/etc,/etc/directory,/usr/local/etc

Help files:/usr/share/man,/usr/share/doc,/usr/local/share/man,/usr/local/share/doc

4.Linux the following file types:

-: Normal file

D: Catalog file

B: Block device

C: Character device

L: Symbolic Link file

P: Piping File pipe

S: Socket file socket

5. Absolute path and relative path, this means that the absolute path is the full name, for example: XXX, Xi ' an city, Shaanxi province, Weiyang District Long first village + name. (that is, narrowing down from a large area)

The relative path is a small range of salutation, for example: Dragon's Head village + name (because you are already in the village, directly say the name, we all know so no need to add the prefix of the front long)

Absolute path: is a description from the beginning of the position, has root/beginning for example: Ll/etc/sysconfig/network

Relative path: is already in a file directory is not already root open for example: LL Sysconfig/network (already in the ETC directory)

Most relative paths are relative to the current directory (soft connection exceptions)

6. File wildcard: Plainly speaking, it is generally used only for file name matching. (matches a string that is a file name, not a string of files)

* Match 0 or more characters

? Match any single character (including kanji)

~ Current User Home Directory

~mage User Mage Home directory

~+ Current Working Directory

~-Previous working directory

[0-9] Matching number range

[A-Z]: Letters

[A-Z]: Letters

[Wang] matches any one of the characters in the list

[^wang] matches characters other than all characters in the list

Pre-defined character class: Man 7 glob

[:d Igit:]: Any number, equivalent to 0-9

[: Lower:]: Any lowercase letter

[: Upper:]: Any uppercase letter

[: Alpha:]: Any case letter

[: Alnum:]: Any number or letter

[: Blank:]: horizontal white space character

[: Space:]: Horizontal or vertical whitespace characters

[:p UNCT:]: Punctuation

[:p rint:]: Printable characters

[: Cntrl:]: Control (nonprinting) character

[: Graph:]: Graphic character

[: Xdigit:]: hexadecimal character

Practical Walkthrough:

1. Show all files or directories in the/var directory that begin with L, end with a lowercase letter, and have at least one digit in the middle;

ls/var/l*[[:d Igit:]]*[[:lower:]]

2. Displays files or directories that start with any digit in the/etc directory and end with a non-digit

ls/etc/[[:d igit:]]*[^[:d igit:]]

7. Index node: This I have described in the previous document, simply say that all files in Linux, each file has a related node directory, in the node holds the owner identity and permissions, and time information. Each message has a number that is unique. While Linux is the node information to identify the file, the file is different, the node number is not the same, the partition is different, even if the node number of the same file is not the same, this is the index node.

8. Soft and hard connection: This is also described in the previous blog: (http://blog.51cto.com/13872354/2151896)

      Hard Links: Links can only be made between files in the same file system and cannot be created on the directory. If you delete the source file for the hard link, the hard-link file still exists, and the original content is saved, which can prevent the file from being mistakenly deleted because of the wrong operation. Because a hard link is a file with the same node number with only a different file name, deleting a hard-link file does not affect other files that have the same node number.

Soft connection: Can be linked in multiple file systems, support for the creation of the directory, the removal of soft links does not affect the point of the file, but if the original file is pointed to be deleted, then the relevant soft link becomes a dead link.



Linux file directory

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.