ZhangZhihui's Blog  
zzh@ZZHPC:~$ cat .bash_history

zzh@ZZHPC:~$ echo $HISTFILESIZE     ## in file
2000

zzh@ZZHPC:~$ echo $HISTSIZE     ## in memory
1000

zzh@ZZHPC:~$ !8     ## execute the 8th command in history

zzh@ZZHPC:~$ pwd
/home/zzh
zzh@ZZHPC:~$ !! ## execute the previous command
pwd
/home/zzh

zzh@ZZHPC:~$ !-7     ## execute the 7th last command

zzh@ZZHPC:~$ !ping     ## execute the last ping command (with its arguments)

zzh@ZZHPC:~$ !ping:p     ## just print the last ping command (with its arguments), not execute it

zzh@ZZHPC:~$ history -d 6     ## delete the 6th command from history

zzh@ZZHPC:~$ history -c     ## clean history

 

posted on 2023-08-06 10:41  ZhangZhihuiAAA  阅读(13)  评论(0编辑  收藏  举报