Update history.md

This commit is contained in:
小弟调调™ 2022-04-06 10:06:16 +08:00 committed by GitHub
parent 4768ac0ced
commit 235e2764ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 8 deletions

View File

@ -42,15 +42,10 @@ filename可选表示历史文件默认调用顺序为`filename`、环
## 例子 ## 例子
使用history命令显示最近使用的10条历史命令 使用history命令显示最近使用的 5 条历史命令
```shell ```shell
[root@localhost ~]# history 10 [root@localhost ~]# history 5
92 ls
93 cd ..
94 ls
95 exit
96 ls -a
97 cd .ssh/ 97 cd .ssh/
98 ls 98 ls
99 cat known_hosts 99 cat known_hosts
@ -64,7 +59,14 @@ filename可选表示历史文件默认调用顺序为`filename`、环
[root@localhost ~]# history -c [root@localhost ~]# history -c
``` ```
更多实例: 删除制定的行
```shell
[root@localhost ~]# history -d <指定行号>
[root@localhost ~]# history -d 2243
```
快捷执行一条历史命令
```shell ```shell
# 执行第 n 条历史命令 # 执行第 n 条历史命令