彩色的 grep、man

參考自Tsung's Blog:grep、man 顏色設定

    為 grep 上顏色:
  • 編輯 ~/.bashrc
  • 加上這行顏色設定:
  • alias grep='grep --color'

  • 如此一來以後使用 grep 時就會以顏色標出搜尋字串了。
    彩色的 man:
  • 編輯 ~/.bashrc
  • 加上顏色設定:
  • #For colourful man pages (CLUG-Wiki style)
    export LESS_TERMCAP_mb=$'\E[01;31m'
    export LESS_TERMCAP_md=$'\E[01;31m'
    export LESS_TERMCAP_me=$'\E[0m'
    export LESS_TERMCAP_se=$'\E[0m'
    export LESS_TERMCAP_so=$'\E[01;44;33m'
    export LESS_TERMCAP_ue=$'\E[0m'
    export LESS_TERMCAP_us=$'\E[01;32m'

  • 往後用 man 看說明時就更好讀囉。

Post a Comment

*Required
*Required (Never published)