Linux system-1 unit-command line usage skills

The relationship between terminal and shell

Terminal : It is actually a physical device, that is, the input and output device of the computer. The window we opened by right-clicking on RedHat is also a terminal. We call this terminal a terminal emulator, which simulates a terminal device through software. We can call it a virtual terminal. The ways to open the terminal are:

1. Right-click and click open in terminal
2. Applications->system tools->terminal
3. Under the opened terminal, execute gnome-terminal
4. Add shortcut keys under applications->system tools->setting->keyboard

Insert picture description here
Shell : A shell is actually an application program that implements an interface for users to access the operating system. The shell used by default in RHEL8 is'bash'.Insert picture description here

The difference between the two: the
terminal itself does not parse commands, it is just an interface, which is responsible for human-computer interaction. The real command is the shell. The terminal is only responsible for providing an interactive interface for inputting commands. The commands running in it are completed by a special command execution program shell.
The relationship between the two:
Shell is a program, a binary executable program. The terminal program will automatically call the shell program, and each time the terminal is opened, the terminal will automatically call the shell. If the terminal successfully invokes the shell program, the terminal will display the following information:
Insert picture description here

Shortcut keys in the shell

1. Use of shortcut keys in the shell

<ctrl>+<shift>+<T>          					    ##在一个terminal中开启多个窗口
<ctrl>+<shift>+<N>     						        ##重新打开一个terminal
<ctrl>+<c>                  						##取消命令执行
<ctrl>+<d>                  					    ##关闭shell
<ctrl>+<shift>+<鼠标选中>+<c>			            ##复制选中字符
<ctrl>+<shift>+<v>                                  ##粘贴
##鼠标选中为复制
##鼠标滚轮下按为粘贴

2. How to execute commands in the shell

2.1 The format of the execution command:

Command parameter object The
command is the program, and the
parameter represents the special function of the command. The
object is the operation target在这里插入代码片

2.2 Method of command execution

有些命令可以单独执行,不需要指定参数和对象。
参数可以叠加
-a -b -c 相当于 -abc 相当于-acb 相当于 -cab
 参数 -s  表示单词缩写
 参数 --size 表示单词全拼

3. Three ways to get help from the command line

1.whatis rm                         ##查看命令的基本用途
查看过程中出现
**rm: nothing appropriate.**
1.表示要查看内容没有帮助
2.系统帮助数据未更新需要切换至超级用户执行mandb进行更新

Insert picture description hereInsert picture description hereInsert picture description here

2.rm --help                         ##查看命令的基本用法

Insert picture description here

对于命令使用格式中,符号的含义:
[ ]                                ##内容可加可不加
...                                ##内容个数任意
<>                                 ##必须在命令执行时加入的元素
3.man rm                   ##命令用法详解 man是manual的缩写
man -k passwd                ##passwd关键字有多少级别的man
##man的级别
#1 命令
#2 系统调用
#3 函数库调用
#4 特殊文件(设备文件等)
#5 文件
#6 游戏
#7 特殊的包
#8 系统管理命令
#9 内核信息规则
q                     ##退出
/关键字                ##搜索关键字,n 向下匹配, N 向上匹配
G                     ##快速移动到man的最后
g                     ##表示快速移动到man的最前

4. Linux command history call
The shell we currently use can record the historical commands executed in the system

history                        ##查看历史命令
history -c                     ##清空当前历史命令
历史命令的调用
上键|下键                     ##逐行调用
!数字                         ##调用指定行历史
!字符                         ##调用以此字符开头的最近历史
<ctrl>+<R>                  ##开启历史搜索模式,命令行显示会变为:
(reverse-i-search)`':输入关键字
会显示含有此关键字的最近一条历史

To clear the history permanently, you need to clear the file.bash_history

5. Use of TAB key

补齐系统中存在的命令,文件和某些命令的参数
当按一次tab没有效果,表示以此字符开头的信息不唯一可连续按2次
那么会把以此字符开头的所有内容显示
如果2此仍然不显示表示没有以此字符开头的指令

Guess you like

Origin blog.csdn.net/m0_46988935/article/details/108853814