File:/home/kiosk/desktop/09.24 Page 1 of 7
######## Virtual Machine Control ###########
[[Email protected]]$ rht-vmctl start Desktop # # #开启虚拟机desktop
Starting desktop.
[[Email protected]]$ rht-vmctl View Desktop # # #显示虚拟机desktop的视图
[[Email protected]]$ rht-vmctl poweroff Desktop # # #关闭虚拟机desktop
Powering off desktop.
[Email protected]]$ rht-vmctl View Desktop
Error:unable to view Desktop-not currently running. # # #报错: Virtual machine Desktop is not currently running
[Email protected]]$ gedit # # #新建文档并打开
^c
[[Email protected]]$ gedit 09.24 & # # #新建文档并打开
######### language Adjustment #######
Applications--SystemTools-->settings-->ragin &language-->language
After Setup is complete, type the reboot command on the terminal port to restart the virtual machine
#####################
##### #第一单元 ########
####################
System: Environment
Kernel: Is the brain of the operating system, scheduling software
Shell: The protective layer of the kernel
# # 1. Line Prompt #####
[[Email protected]]$
Kiosk # #打开shell的用户
@ # #分隔符
FOUNDATION46 # #主机名称
Desktop # #工作目录名称
$ # #身份提示符, "#" means Superuser, "$" for ordinary users
Note: The command needs to be entered after the line prompt to execute
# # # 2. Switch User #####
[Email protected]]$ su-username # #高级用户切换至低级用户不需要密码, when a low-level user switches to an advanced or peer user
Password required
# # # 3. Virtual Console #####
Ctrl+alt+f (1|7) into the graph
Ctrl+alt+f (2~6) into the Virtual Console
Red hat Enterprise Linux Server 7.0 (Maipo) # #系统版本
Kernel 3.10.0-123.e17.x86_64 on a x86_64 # #内核版本, System bit
DESKTOP0 Login: # #登陆用户名称输入
Password: # #密码输入 (no echo)
# # # 4. Command Execution # # # #
1. The command must be entered after the line prompt
2. Command format
Command (space) parameter (space) target
3.ctrl+c # #撤销命令的执行
4. Command parameters
-Parameter # #单词缩写
--Parameter # #单词的全拼
File:/home/kiosk/desktop/09.24 Page 2 of 7
# # # 5. Command Help # # #
1.
Whatis Command # #查看命令的功能
Command (space)--help# #查看命令的帮助
[] # #选择加入的内容, can be added without
... # #加入内容的个数任意
<> # #内容在命令执行过程当中必须要加
# # # # # # # # 6-Basic method of system use
1. System Login
Graphical login mode
Text login mode
2. Work Interface Conversion
ctrl+alt+ on | down
3. Start Bash
(1) Applications>utilities>terminal
(2) right mouse button------>open in Teminal
(3) Gnome-teminal
(4) Shift +ctrl +n or ctrl +shift +n
(5) Exit: Exit |ctrl +d
4. System shutdown, restart
Restart
Reboot |init 6 |shutdown-r now
Shutdown
Poweroff |init 0 |shutdown-h now
5. Lock Screen
CTRL +alt +l
# # #简单的系统命令
1) Date
Watch-n 1date # # #让date命令每秒执行一次
Date 11181115 # # #把系统时间设定为11月18日11:15 format: Every hour of the month
Date 111811152016.55 # # #2016表示年 (can not be added), 55 for seconds (can not add)
-D +xday-xday # #查看x天之前或者后的时间
+% .... # #设定date的输出格式
2) passwd
(1) passwd change user password
[Email protected] ~]# passwd
changing passwd foruser root. # #改变超级用户密码
New Password: # #输入密码
Bad Password:the PASSWORD is shorter than 8characters
Retype new Password:
Passwd:all authentication tokens updated successfully.
[[Email protected]]$ passwd
changing password Foruser kiosk. # #改变普通用户密码
changing password Forkiosk.
(current) UNIX Password: # #输入当前密码
New Password:
Bad Password:the PASSWORD are the same as the old one # #和原始密码不能太相似
File:/home/kiosk/desktop/09.24 Page 3 of 7
New Password:
Bad password:the PASSWORD fails the dictionary check-it is too simplistic/systematic # #密码太过简单, must
is an unordered number + letter
New Password:
Bad Password:the PASSWORD is shorter than 8characters # #密码必须 >8 bit
########################################################
# #注意: The above rules can be ignored when a superuser gives an ordinary user or sets a password for himself.
#######################################################
passwd parameter User name
-S # #用户密码信息
--status ....
-L # #锁定帐号
-U # #解锁
-N # #设定密码最短有效期
-X # #设定密码最长有效期
-W # #警告期
-I # #设定用户活跃天数
-D # #清楚用户密码
Monitoring passwd Password Information
Watch-n 1passwd-s Student
3) file
File File name # #查看文件类型
4) Viewing of files
Cat # #显示文件的全部内容
Head # #显示一个文件的前几行 (default = 10)
Example: Head-n 5 +file
Tail # #显示文件的后几行 (default = 10)
Example: Tail-n 4 +file
5) WC Statistics file capacity information
Wc-l Number of rows
-W Words
-C bytes (Chinese one word occupies three bytes)
-M character Count
WC file Name # #显示文件关于 all information for "word"
##### Tab key #########
The table key in the system can automatically complement the existing command, the file name and the parameters of some commands
A+tab X2 # #显示系统中所有a开有的命令
# # # #history历史调用 ######
History # #显示历史
HISTORY-C # #清除当前环境当中的历史命令
! number # #执行第多少行命令
! Letter # #执行最近一条以这个字母开头的命令
CTRL +r + keywords # #执行最近一条含有这个关键字的命令
Down Key # #逐行调用命令
##### shortcut keys in Linux ######
Around # #一个字符一个字符移动
CTRL + Around # #一个字一个字移动
+a # #光标移动到行首
+ E # #光标移动到行尾
+u # #光标所在位置删除到行首
+k # #光标所在位置删除到行尾
File:/home/kiosk/desktop/09.24 Page 4 of 7
+r+ keyword # #调出最近一条含有关键字的命令
+ left | Right # #光标移动以单词为单位
+c # #撤销已输入的命令
+d # #关闭当前环境
+shift +t # #在现有shell中重新打开一个table
+shift +pageup|pagedown # #切换table
+alt +l # # Lock Screen
+alt + up | Down # #切换工作界面
+alt +f1|f7 # #进入图形界面
+alt +f2-f6 # #进入虚拟控制
####################################
########. 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, which is automatically established by the system when olefins are 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 # #系统用户相关信息数据及用户自定义软件存放位置
##### end######
###################
# # # Two. File Addressing # # #
###################
Absolute path: File in the real location of the system, the file name begins with "/"
Relative path: Shorthand for the name of the file relative to the location of the current position, which does not start with/, and the name automatically adds the value of the PWD display
# # end###
#########################
# # # # three. Document Management ########
#########################
PWD # #查看当前文件所在的工作路径
####### 1.touch Build file or modify file timestamp # # #
Touch File # #创建文件
####### 2.mkdir Building Directory ###########
mkdir Directory # #创建目录
-P # #上级目录不存在自动建立
File:/home/kiosk/desktop/09.24 Page 5 of 7
####### 3.rm Delete a directory or file ######
Rm-f # #强行删除不提示
-R # #删除目录
####### 4.cat|head|tail View File Contents # # # #
Cat|head|tail # #文件内容查看命令
####### 5.vim text Edit file ######
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 exit Insert mode and enter ": Wq" to save exit
Vim filename If the name does not exist, it will be created automatically
Vim does not have the action object opened directly, after editing the file to ": Wq filename" # #即强制要求保存对文件命名与保存
########### 6.cd Switch working directory #########
CD Directory # #切换工作目录到指定的目录
CD-# #切换工作目录到之前的目录
CD ~ # #切换到自己的家目录
CD ~username # #切换到指定用户的家目录
Cd.. # #进入当前目录的上一级目录
######### 7.ls lists directory or file information #####
LS # #如果后面没有目标, then the default is that the current directory
ls Directory |filename # #列出文件或目录内容
ls-d Directory # #列出目录本身
ls-l filename |directory # #列出文件或目录里面内容的属性
Ls-ld Directory # #列出目录本身属性
Ls-a # #列出目录中的所有内容, including with "." Hidden files at the beginning
Ls-r # #第归显示目录中的内容
###### 8. CP File Copy #######
CP is the process of creating a new file
CP file File1 file2. Directory # #把file file1 file2 copied into directory
CP File Test # #建立test文件模板为file
Cp-r Directory Directory1 # #复制目录
##### 9. MV Move or rename ######
When the MV of the same disk is renamed, the copy deletion process is in the MV of different disks
MV File file1 Directory # #移动file file1 into Directory
MV exists file does not exist file # #重命名文件
MV Westos/linux. # #把westos中的linux移动到当前目录. Represents the current directory
######## #end ########
###########################
##### Four. Regular Expression #########
###########################
* # #匹配0到任意字符
? # #匹配单个字符
[[: Alpha:]] # #匹配单个字母
[[: Lower:] # #匹配单个小写字母
File:/home/kiosk/desktop/09.24 Page 6 of 7
[[: Upper:] # #匹配单个大写字母
[[:d Igit:] # #匹配单个数字
[[: Alnum:] # #匹配单个数字或字母
[[:p UNCT:] # #匹配单个符号
[: Space:] # #匹配单个空格
{} indicates a nonexistent or existing
{1..9} # #1-9
{A.. F} # #a-F
{1,3,5} # #1 3 5
{A,c,e} # #a C e
{1..3} {A.. C} # #1a 2a 3a 1b 2b 3b 1c 2c 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 # #指定的用户家目录
~+ # #当前目录
~-# #当前目录之前所在目录
. # #当前目录
.. # #当前目录的上一级
# # # end#####
###################
# # # # Unit 3#######
###################
#################
# # # 1. Mans #####
#################
Man->>manual # #man是手册缩写
Man Mans # #查看man命令的帮助
Man passwd # #查看passwd命令的帮助
The level of man
1 system commands
2 System interface
3 Function libraries
4 special files, such as device files
5 files
6 games
7 Package for the system
8 System Administration Commands
9 cores
Man 5passwd # help #查看/etc/passwd file
Man 1PASSWD # #查看passwd命令的帮助, 1 can be omitted
A shortcut to the man page
Down Key # #向上或向下一行
Pageup|pagedown # #向上或者向下一个屏幕
D|u # #向下或者向上半个屏幕
G|GG # #调转页面到man最下面或最上面
File:/home/kiosk/desktop/09.24 Page 7 of 7
/keyword # #搜索关键字, keywords are highlighted, n is matched, n up
Q # #退出帮助页面
###################
# # # # Unit 4#######
###################
#####################
# # 1. Manage input/Output # # #
#####################
In a Linux system, the correct output number is 1, the error output number is 2
Perform "student" with ordinary users in the system
Find/etc-name passwd
Because the student user rights issue will have the following output
Find: '/etc/pki/ca/private ':P ermission denied # #没有进入权力, error
Find: '/etc/pki/rsyslog ':P ermission denied
Find: '/etc/audit ':P ermission denied
/ETC/PASSWD # #正确输出
Find: '/ETC/POLKIT-1/RULES.D ':P ermission denied
Find: '/etc/polkit-1/localauthority ':P ermission denied
Find: '/etc/dhcp ':P ermission denied
Find: '/etc/selinux/targeted/modules/active ':P ermission denied
Find: '/etc/lvm/archive ':P ermission denied
Find: '/etc/lvm/backup ':P ermission denied
Find: '/etc/lvm/cache ':P ermission denied
Find: '/ETC/GRUB.D ':P ermission denied
/ETC/PAM.D/PASSWD # #正确输出
Find: '/etc/audisp ':P ermission denied
Find: '/etc/firewalld ':P ermission denied
Find: '/etc/cups/ssl ':P ermission denied
Find: '/etc/ipsec.d ':P ermission denied
Find: '/etc/libvirt ':P ermission denied
Find: '/ETC/SUDOERS.D ':P ermission denied
Find: '/etc/named ':P ermission denied
Find/etc-name passwd >file # #重新定向正确输出
Find/etc-name passwd 2>file # #重新定向错误输出
Find/etc-name passwd &>file # #重新定向所有输出
Note: ">", "2>", "&>" will overwrite the source file
>file # #清空file
Find/etc-name passwd >>file # #追加正确输出
Find/etc-name passwd 2>>file # #追加错误输出
Find/etc-name passwd &>>file # #追加所有输出
Note:>> 2>> &>> does not overwrite the contents of the source file, it will characters the corresponding output word to the end of the file.
| The function of a pipe is to change the output of the previous command into the input of the post-pipeline command.
Ls/bin |wc-l # #统计ls The number of rows output by the/bin command
The wrong output in the system is not available through the pipeline.
Use 2>&1 to change the wrong output number from 2 to 1.
Tee copy output to specified location
Date |tee file |wc-l # # #tee命令复制date命令的输出到file中, and count the number of output rows
This article is from the "12097560" blog, please be sure to keep this source http://12107560.blog.51cto.com/12097560/1857891
Linux for the first time notes