yuzhongdelei0 2020-06-13
history [-c] [-d offset] [n] history -anrw [filename] history -ps arg [arg...]
环境变量可以 export 变量名="值" 形式存放在 /etc/profile 或 ~/.bash_profile
whoami
" 显示时间和用户[ ~]#cat .bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH export HISTCONTROL=ignoreboth export HISTTIMEFORMAT="%F %T " [ ~]#history 1 2019-12-13 08:39:05 ls /data 2 2019-12-13 08:39:05 date 3 2019-12-13 08:39:05 vie0 4 2019-12-13 08:39:05 nano .bash_profile 5 2019-12-13 08:39:05 exit
重复前一个命令使用上方向键,并回车执行
按 !! 并回车执行
输入 !-1 并回车执行
按 Ctrl+p 并回车执行
!:0