I. Linux system architecture
Linux is an inverted tree structure
Everything in Linux is a file.
These files are at the top of the system directory "/"/is the root directory
/directory Below is a level two directory these directories are automatically created when the system is installed
The role of the secondary directory
/bin # #二进制可执行文件也就是系统命令
/sbin # #系统管理命令存放位置
/Boot # #启动分区, responsible for system startup
/Dev # #设备管理文件
/etc # #大多数系统管理文件
/Home # #普通用户的家目录
/lib # #32位系统库文件存放位置
/LIB64 # #64位系统库文件存放位置
/media # #系统临时设备挂载点
/MNT # #系统临时设备挂载点
/run # #系统临时设备挂载点
/OPT # #第三方软件安装位置
/proc # #系统信息
/root # #超级用户家目录
/srv,/var # #系统数据
/sys # #系统管理, mostly about the kernel
/tmp # #系统临时文件存放位置
/usr # #系统用户相关信息数据及用户自定义软件存放位置
Two. Addressing the file
Absolute path
File in the real location of the system, the file name begins with "/"
Relative path
The file relative to the current location of the name of a shorthand, the name does not start with/, and the name will automatically add the value of the PWD display
Three. Management of documents
Touch to create a file or modify a file stamp
[[email protected] desktop]# Touch file 650) this.width=650; "src=" http://img.blog.csdn.net/20170330122634338 "alt=" 20 170330122634338 "/>
2.mkdir Creating a Directory
-P Parent Directory does not exist automatically established
[Email protected] desktop]# mkdir test
650) this.width=650; "src=" http://img.blog.csdn.net/20170330122811120 "alt=" 20170330122811120 "/>
650) this.width=650; "src=" http://img.blog.csdn.net/20170330123059158 "alt=" 20170330123059158 "/>
3.RM Deleting files
-F forcibly removed without prompting
-R Recursive Delete
650) this.width=650; "src=" http://img.blog.csdn.net/20170330123225825 "alt=" 20170330123225825 "/>
4.cat Head Tail View file contents
See Chapter I.
Edit files in 5.vim text 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 Working directory
CD Directory # #切换工作目录到指定目录
CD-# #切换工作目录到之前所在目录
CD ~ # #切换到自己的家目录
CD ~usernmae # #切换到指定用户家目录
Cd.. # #进入到当前目录的上级目录
650) this.width=650; "src=" http://img.blog.csdn.net/20170330123836235 "alt=" 20170330123836235 "/>
7.list listing directory or file information
LS # #如果后面没有目标那么默认目标为当前目录
LS Direcory|filename # #列出文件或目录内容
ls-d Direcotry # #列出目录本身
Ls-l Filename|dorectory # #列出文件或目录里面内容的属性
Ls-ld Directory # #列出目录本身属性
Ls-a # #显示目录中的所有内容, including with "." Hidden files at the beginning
Ls-r # #第归显示目录中的内容
650) this.width=650; "src=" http://img.blog.csdn.net/20170330124744770 "alt=" 20170330124744770 "/>
8.CP file copy
CP is the process of creating a new file
CP file File1 file2. Directory # # #把file file1 file2 copied to directory
CP File Test # # # #建立test文件模板为file
Cp-r Directory Direcotry1 # # #复制目录
9.MV Move or rename
The MV of the same disk is renamed, and the MV of different disks is the copy-delete process
MV file file1 direcotry # #移动file file1 to Directory
MV exists file does not exist file # #重命名文件
MV Westos/linux. # #把westos中的linux移动到当前目录. Represents the current directory
Four. Regular expressions
* # # #匹配0到任意字符
? # # #匹配单个字符
[[: Alpha:]] # # #匹配单个字母
[[: Lower:]] # # #匹配单个小写字母
[[: Upper:]] # # #匹配单个大写字母
[[:d Igit:] # # # #匹配单个数字
[[: Alnum:]] # # #匹配单个数字或字母
[[:p UNCT:] # # # #匹配单个符号
[[: Space:]] # # #匹配单个空格
{} indicates a nonexistent or existing
{1..9} # # #1-9
{A.. F} # # #a-F
{1,3,5} # # #135
{a,c,e} # # #a c E
{1..3} {A.. C} # # #1a 2a 3a 2a 2b 2c 3a 3b 3c
[] Indicates the existence of the
[A-c] # # #aA BB CC
[A-c] # # #aA或者bB或者c
[1-3] # # #1或者2或者3
[145] # # #1或者4或者5
[^abc]| [!ABC] # # #除了a并且除了b并且除了c
~ # # #当前用户家目录
~username # # #指定的用户家目录
~+ # # #当前目录
~-# # #当前目录之前所在目录
. # # #当前目录
.. # # #当前目录的上一级
LINUX redhat second unit document