man 手册增加颜色

  1. export LESS_TERMCAP_mb=$'\E[1m\E[32m'
  2. export LESS_TERMCAP_mh=$'\E[2m'
  3. export LESS_TERMCAP_mr=$'\E[7m'
  4. export LESS_TERMCAP_md=$'\E[1m\E[36m'
  5. export LESS_TERMCAP_ZW=""
  6. export LESS_TERMCAP_us=$'\E[4m\E[1m\E[37m'
  7. export LESS_TERMCAP_me=$'\E(B\E[m'
  8. export LESS_TERMCAP_ue=$'\E[24m\E(B\E[m'
  9. export LESS_TERMCAP_ZO=""
  10. export LESS_TERMCAP_ZN=""
  11. export LESS_TERMCAP_se=$'\E[27m\E(B\E[m'
  12. export LESS_TERMCAP_ZV=""
  13. export LESS_TERMCAP_so=$'\E[1m\E[33m\E[44m'

修改 history

history 默认 500 条, 经常使用命令行会不够用, 可以做如下修改:

  1. export HISTFILESIZE=10000000
  2. export HISTSIZE=10000000.

HISTFILESIZE 与 HISTSIZE 的区别:

  • HISTFILESIZE 决定在 history 文件中能保存多少行;
  • HISTSIZE 能在内存中保存多少行.

HISTFILESIZE determines the number of lines to keep in the history file while HISTSIZE determines the number of lines to keep in memory. Both default to 500 Execute echo $HISTFILESIZE $HISTSIZE before you make the change and then again after. You should see 10000000 500 first then 10000000 10000000 after.