Linux file system hierarchy and file management

Source: Internet
Author: User
Tags alphabetic character

This post mainly describes how to use command management Linux the file, first we look at Linux File Hierarchy of file system:

650) this.width=650; "title=" QQ picture 20151209170115.png "Src=" http://s4.51cto.com/wyfs02/M00/77/73/ Wkiom1zn7fxb4zlvaablmphtp54255.png "alt=" Wkiom1zn7fxb4zlvaablmphtp54255.png "/>

Directory types are: Static, dynamic, or variable, persistent, runtime

Here is a detailed description of the role of each file:

/bin Binary executable commands, configuration commands required by the system

/ Boot files required to start the process

/ Dev contains special device files that are used by the system to access hardware

/ etc system administration and configuration Files

/Home The home directory where ordinary users store their personal data and configuration files, such as user User The home directory is /home/user , you can use ~user represents

/root (super User) system administrator's home directory

/run run-time data for the process that was started since the last system startup. Includes the process ID file and the lock file, and the contents of this directory are recreated on restart.

/sbin system administration commands, which are stored in the hypervisor used by the system administrator

/tmp 10 Files that are not accessed, changed, or unmodified within the day are automatically removed from the directory. There is also a temp directory /var/tmp If the files in this directory are in 30

/ usr The largest directory, installed software, shared libraries, including files and static read-only program data. Among the important subdirectories are:/usr/bin user commands,/usr/sbin System administration commands,/usr/local Local custom software

/ var variable data that is specific to this system and remains persistent between system startup. dynamically changing files (e.g. databases, cache directories, log files, printer background processing documents, Web site content, etc.)

/lib The shared library required by the program on the root file system, which holds the shared files required for the root file system program to run. These files contain code that can be shared by many programs to prevent each program from having a copy of the same subroutine, making the executable smaller and space-saving.


basically, I understand. Linux the structure of the file, the following mainly describes the operation of the Common command file:

PWD command: Displays the current working directory

Ls commands: Displaying files in a directory

ls–l command: This command can display the file contents in a long format , If you need to see more detailed documentation, use ls-l this command.

Ls–a command: Displays all files and folders in the current directory including hidden files

Ls–al command: Displays all files and folders in the current directory including hidden files, and displays details, details including size, group, creation time

Ls–r command: Recursive processing, will view all files and subdirectories under the specified directory.

Absolute path: The path that describes the directory starting at the root

Relative path: Describes the path from the current location

Note: Files and paths are case-sensitive

a file path does not exceed 4095 bytes, with / each part of the split does not exceed 225 bytes

Touch command: Create an empty file, or modify the timestamp of the file

Cd command: Change the working directory, CD after the home relative path can also be added absolute path

each directory has a hidden directory .. that represents the previous level of the directory CD.. go back to the top level directory

~ , the attention record of the current user of the tender

-, indicates the most recently used directory

Mkdir command: To create a directory, when creating a directory, make sure that the same directory does not exist originally

mkdir–p : All new directories on the path can be created at once

Cp command: Copy files and directories, when copying files, the timestamp will be rewritten, indicating that the file has just been modified, you can copy multiple files to a directory at the same time, you can copy the entire directory to another directory, but you need to add - R multiple directories can be copied to a directory at the same time ; - v parameters can display the copied files to the terminal.

Mv command: Move or rename a file

Rm command: Delete a directory or file, you can delete a single anthology, you can delete the directory, but you need to add - R parameters; - I. parameter can open the interaction, the system will ask whether to delete each file

Rmdir command: Delete empty directory, if directory space-time, then you can use rmdir if there are files or subdirectories in the directory, then rmdir you will not be able to delete this directory

To extend the matching file name with a pathname:

file wildcard characters: * any string consisting of 0 or more characters

? Any one character

~ home directory for the current user

~username username User's home directory

~+ Current Working Directory

~- Previous working directory

[ABC ...] any one of the characters in the expanded class

[!abc ...] any one character in a class that is not expanded

[^abc ...] any one character in a class that is not expanded , ibid.

[[: Alpha:]] any alphabetic character

[[: Lower:]] any lowercase characters

[[: Upper:]] any uppercase characters

[[:d igit:]] any number, i.e. 0-9

Command substitution:

$ (command) can add Command the results of the execution as content, or you can use the ' command '

prevents parameters from being extended: any character between two single quotes is treated as a regular character; \ the character after is treated as a regular character


This article is from the "Kang Rice Incense" blog, please be sure to keep this source http://alistine.blog.51cto.com/10034174/1721229

Linux file system hierarchy and file management

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.