junxnone / linux

Linux wiki
https://junxnone.github.io/linux/
0 stars 0 forks source link

Tools history #49

Open junxnone opened 5 years ago

junxnone commented 5 years ago

history 命令行历史管理

UseCase

Usecase cmd
查看历史执行命令 history
执行历史命令 ! number
清除历史命令 history -c
使用 Ctrl+R 搜索历史 Ctrl + R
(reverse-i-search)':`

Config

sudo vi /etc/profile
export HISTTIMEFORMAT="%Y-%m-%d:%H-%M-%S:`whoami`: "
export HISTSIZE=10000

Reference