******** second unit on Linux system *******
1.linux is an inverted tree structure
Everything in Linux is a file.
These things are at the top of the system directory "/"/is the root directory
/directory Below is a level two directory these are the functions of the headset directory that the system automatically establishes when the system is installed.
2. The role of level two directories
/bin * * Binary executable file (System command)
/sbin * * System Management Command storage location
/boot * * boot partition, responsible for system boot
/dev * * Device management files
/etc * * Most system administration files
Home file for normal users
/lib **32-bit system library file storage location
/lib64 **64-bit system library file storage location
/media * * System temporary device mount point
/MNT * * System temporary device mount point (more manual)
/run * * System temporary device mount point
/OPT * * Third-party software installation location
/PROC * * System Information
/root * * Super User home Directory
/srv,/var * * System data
/sys * * System management, mainly on the kernel
/tmp * * System temporary file storage location
/usr * * System user-related information data and user-defined software storage location
* * Address of the file * *
Absolute path: File at the real location of the system, beginning with the file name "/"
Relative path: The file is abbreviated to a name in the current location, and the name does not start with a/, and the name automatically adds the PWD display value
Third, document management
1.touch/* Build file or modify file timestamp
Touch File/ * Create File
2.mkdir Directory/ * Create a Catalog
-P/* Parent directory does not exist automatically established
3.RM Deleting a directory or file
RM-F/* Forcibly delete without prompting
-R/* Delete Directory
4.cat| Head |tail/* View file contents
5.vim/* Text mode Editor
Vim filename enters the command mode
Command mode cannot edit the file if you want to edit the file to enter insert mode
Press "I" to enter insert mode
If you are finished editing, press "ESC" to eject the insert mode and enter ": Wq" to save the exit
Vim filename If the file name does not exist, it will be created automatically
Vim no Action object opens directly, after editing the file to: Wq filename
6.CD Switch Directory
CD directory switch working directory to the specified directory
CD-Switch working directory to previous directory
CD ~ Switch to your home directory
CD ~username switch to the specified user directory
Cd.. Go to the top level of the current directory
7.ls listing directory or file information
LS If there is no target behind then the default target is the current directory
LS directory|filename list file or directory contents
ls-d directory lists the directories themselves
Ls-l Directory|filename lists the properties of the contents of a file or directory
Ls-ld directory lists the properties of the catalog itself
Ls-a directory displays all content in the directory, including the "." Hidden files at the beginning
Ls-r recursively displaying content in a directory
8.CP file copy
CP file File1 file2.....directory move file file1 file2 copied to directory
CP File test renaming files
Cp-r Directory Directory1 Replicating directories
9.MV Move or rename (the MV of the same disk is renamed, the MV of different disks is the copy-delete process)
MV File file1 directory Mobile file file1 into directory
MV presence file does not exist file rename file
MV Westos/linux. Move Linux in Westos to the current directory, representing the current directory
Four. Regular expressions
* Match 0 to any character
? Match a single character
"": Alpha: "" matches a single letter
"": Lower: "" matches a single letter
"": Upper: "" matches a single letter
"": Digit: "" matches a single letter
"": Alnum: "" matches a single letter
"": Punch: "" matches a single letter
": Space:" "matches a single letter
{} indicates nonexistent or exists
{1.. 9} 1-9
{A.. F} a-f
{1,3,5} 135
{A,c,e} a C E
{1.. 3}{a. C} 1a 1b 1c 2a 2b 2c 3a 3b 3c
"" indicates the existence of the
"A-c" AA BB CC
"A-c" AA or BB or C
"1-3" 1 or 2 or 3
"145" 1 or 4 or 5
"^abc" "!abc" except A and B and besides C
~ Current User Directory
~username the specified user directory
~+ current Directory
~-the directory before the current directory
· Current directory
·· Upper level of current directory
Second unit Linux system