Linux Basic Learning Chapter II-fourth chapter notes

Source: Internet
Author: User

Chapter II

# # # #linux系统结构 # #

  1. The Linux system structure is inverted tree-shaped

  2. /bin # # #二进制可执行文件也就是系统命令

    /sbin # # #系统管理命令存放位置

    /Boot # # #启动分区, responsible for system startup

    /Dev # # #设备管理文件

    /etc # # #大多数系统管理文件

    /Home # #普通用户的家目录

    /lib # # #32位系统库文件存放位置

    /LIB64 # # #64位系统库文件存放位置

    /media # # #系统临时设备挂载点

    /MNT # # #系统临时设备挂载点

    /run # # #系统临时设备挂载点

    /OPT # # #第三方软件安装位置

    /proc # # #系统信息

    /root # # #超级用户家目录

    /srv,/var # # #系统数据

    /sys # # #系统管理, mainly about the kernel

    /tmp # #系统临时文件存放位置

    /usr # #系统用户相关信息数据及用户自定义软件存放位置



# # # # #系统文件路径 #####


Absolute path

File in the real location of the system, the file name begins with "/"

Relative path

The name of the file relative to the current position is abbreviated with a name that does not begin with "/", and the name automatically adds the PWD reality value


PWD # # #显示当前在系统的位置

###############################################

LS List # # #列出目标文件, or list content in a directory

-A # # #列出所有

-L # # #列出文件属性

-S # # #列出文件大小

-S # # #按照文件大小排序

-R # # #递归列出

-D # # #指定目录本身

###################################################

CD chage Directory # # # #进入目标目录中

~ # # # #回到当前用户的家目录

~ Username # # # #进入到指定用户家目录

           .. # # #进入当前目录的上一级

-# # # #进入之前所在系统目录


###########################################################

Touch

Touch File # # # #新建文件


##############################################################

Mkdir

mkdir make Directory # # # #建立目录

-P # # #递归建立目录


################################################################

CP is copied to the file destination

-R # #第归复制, using and copying directories


##########################################

MV is moved file destination

MV Old name New name

MV Test/file. # #把test/file move to the current

##########################################

Rm-f # # #强制删除文件

RM-FR # # #强制删除目录

############################################

Vim filename

Press the I key to enter insert mode

Press ESC to browse mode when the file is written

: Q # # #未编辑

: q! # # #未编辑强制退出

: Wq # # #保存退出

: wq! # # #强制保存退出

##################### #通配符 (regular expression) ########################

* # # # #匹配0到任意字符

? # # #匹配任意单个字符

~ # # # #匹配当前用户家目录

~user # # #匹配到user的家目录

~+ # # #当前目录

~-# # #当前目录之前所在的

[ABC] # # # # #有a或者有b或者有c

[!ABC] # # # #除了含有a或者b或者c

[^ABC] # # # #除了含有a或者b或者c

[[: Alpha:]] # #单个字母

[[: Lower:] # #单个小写字母

[[: Upper:] # #单个大写字母

[[: Alnum:] # #单个字母或数字

[[:p UNCT:] # #单个符号, without numbers, letters and spaces

[[:d Igit:] # #数字

[: Space:] # #单个空格


##########################################################

Unit Three

######################## #man命令 #############################

Man level target

Man 1 File name # # # #查找命令的帮助

Man 5 file name # # # #查找配置文件的帮助

Man Exit # # #按q



Shortcut keys in the man command


/Keyword # # #搜索关键字并且高亮显示结果

N # # #向下匹配高亮结果

N # # #向上匹配高亮结果

Pagup # # #向上滚动一个屏幕

Pagdown # # #向下滚动一个屏幕

Up Key # # #向上滚动一行

Next Key # # #向下滚动一行

D # # #向下滚动半个屏幕

U # # #向上滚动半个屏幕

G # # #回到man的最前面

G # # #回到man的最后面

Q # # #退出man页面


##################/usr/share/doc/*##############

The files in this directory are the instructions for the Software installation package



################################################################
Unit Four



Execute under normal user

Find/etc-name passwd

Output

Find: '/etc/pki/ca/private ': Permission denied

Find: '/etc/pki/rsyslog ': Permission denied

Find: '/etc/audit ': Permission denied

/ETC/PASSWD # # #正确输出

Find: '/ETC/POLKIT-1/RULES.D ': Permission denied

Find: '/etc/polkit-1/localauthority ': Permission denied

Find: '/etc/dhcp ': Permission denied

Find: '/etc/selinux/targeted/modules/active ': Permission denied

Find: '/etc/lvm/archive ': Permission denied

Find: '/etc/lvm/backup ': Permission denied

Find: '/etc/lvm/cache ': Permission denied

Find: '/ETC/GRUB.D ': Permission denied

/ETC/PAM.D/PASSWD # # #正确输出

Find: '/etc/audisp ': Permission denied

Find: '/etc/firewalld ': Permission denied

Find: '/etc/cups/ssl ': Permission denied

Find: '/etc/ipsec.d ': Permission denied

Find: '/etc/libvirt ': Permission denied

Find: '/ETC/SUDOERS.D ': Permission denied

Find: '/etc/named ': Permission denied

How to manage output

Find/etc-name passwd > File # # # #重定向正确输出

Find/etc-name passwd 2> File # # # #重定向错误输出

Find/etc-name passwd &> File # # # #重定向所有输出

Find/etc-name passwd >> File # # #追加正确输出

Find/etc-name passwd 2>> File # # # #追加错误输出

Find/etc-name passwd &>> File # # # #追加输出

Find/etc-name passwd > File 2>&1 # # # #重新定义错误输出为正确

How to apply Pipelines

|

The pipeline allows the correct output to pass

|tee

Copy an output

2>&1 |

Conversion error output to correct again by pipeline

######################### #vim用法 ####################

1. Command mode

Set

Vim/etc/vimrc

: Set Nu|nonu # # # #行号的显示

: Set Mouse=a # # # #设定鼠标可以操作光标位置

: Help # # # #查看vim的用法,: Q quit

Ctrl + V # # # #高亮选择模式, you can choose one area to operate

U # # # #恢复到未操作之前

CTRL + R # # # #恢复到操作之后

Bulk Add characters

Ctrl + V Select the bit where you want to add the characters, press the I key, add the characters you want to add, press ESC

# # #分屏功能

Ctrl+w S # # # #上下分屏

Ctrl+w v # # # #左右分屏

Ctrl+w C # # # #撤销光标所在屏幕

Ctrl+w | down | left | Right # #移动光标到指定的屏幕中

##### #替换字符 ###########

in command mode

:%s/original character/replacement character/g # # # replace all original characters

:%s/original character/replacement character/# # # #替换每行开头含有原字符的

######### #搜索关键字 #########

/keywords

N ###### #向下匹配

N ##### #向上匹配

################### #字符的管理 ################

DW # # # #删除光标所在单词

DL # # # #删除光所在字母

DD ###### #删除一整行

D Number D # # # # #删除数字指定的行数

D number up key ###### #向上删除指定行数

YW ###### #复制光标所在单词

YL ######## #复制光所在字母

YY ######## #复制一整行

P ####### #粘贴

Y Digit y ##### #复制数字指定的行数

CW ######## #剪切光标所在单词

CL ######## #剪切光所在字母

CC ######### #剪切一整行

C Digital C ###### #剪切数字指定的行数

When the cut is finished, it goes into insert mode, to paste out of insert mode and then press the P key.

############### #移动光标到指定行 ############

: line number

G # #移动光标到文件末行

GG # # #移动光标到文件行首

2.vim Plug-in mode

I ##### #光标坐在位置插入字符

I ###### #光标所在行行首插入

A ###### #光标所在字符的下一位插入

A ####### #光标所在行行尾插入

o ##### #光标所在行的下一行

O ##### #光标所在行的上一行

S # # # #删除光标所在字符插入

S ##### #删除光标所在行插入

Exit mode of 3.vim

Enter in command mode

: Q # # #退出, can be used when no changes have been made to the file

: q! # # #强制退出

: Wq # # #退出保存

: wq! # # #强制退出保存

############## #vimtutor ##########

Vimtutor is a description tool for VIM

Use: Q to exit the tool

############## #图形中的文本编辑器gedit #################

Crtl+n # #新建窗口

Ctrl+s # #保存文件

Ctrl+o # #打开文件

Ctrl+x # #剪切

Ctrl + V # #粘贴

CTRL + C # #复制

For Giedit software help view can be used

Yelp Help:gedit


This article is from the "12112684" blog, please be sure to keep this source http://12122684.blog.51cto.com/12112684/1861711

Linux Basic Learning Chapter II-fourth chapter notes

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.