一 历史命令
1、语法
history [选项] [历史命令保存文件]
选项:
-c:清空历史命令
-w:把缓存中的历史命令写入历史命令保存文件~/.bash_histoty
2、历史命令调用方式
3、命令与文件补全
二 实战
[root@localhost ~]# history -w
[root@localhost ~]# history
1 cat .bash_history
2 history -w
3 history
[root@localhost ~]# vi /etc/profile
[root@localhost ~]# history
1 cat .bash_history
2 history -w
3 history
4 vi /etc/profile
5 history
[root@localhost ~]# !3
history
1 cat .bash_history
2 history -w
3 history
4 vi /etc/profile
5 history
6 history
[root@localhost ~]# !!
history
1 cat .bash_history
2 history -w
3 history
4 vi /etc/profile
5 history
6 history
[root@localhost ~]# !cat
cat .bash_history
cat .bash_history
history -w
[root@localhost ~]# user
useradd userdel userhelper usermod usernetctl users
[root@localhost ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
[root@localhost ~]# cd /
bin/ dev/ home/ lib/ media/ mydata/ proc/ run/ srv/ tmp/ var/
boot/ etc/ japan/ lib64/ mnt/ opt/ root/ sbin/ sys/ usr/
[root@localhost ~]# cd /
bin/ dev/ home/ lib/ media/ mydata/ proc/ run/ srv/ tmp/ var/
boot/ etc/ japan/ lib64/ mnt/ opt/ root/ sbin/ sys/ usr/
[root@localhost ~]# cd /usr/
bin/ etc/ games/ include/ lib/ lib64/ libexec/ local/ sbin/ share/ src/ tmp/
[root@localhost ~]# cd /usr/l
lib/ lib64/ libexec/ local/
[root@localhost ~]# cd /usr/l
lib/ lib64/ libexec/ local/
[root@localhost ~]# cd /usr/local/