Man, more, less, grep에서 색깔이 나오게 만들어 봐요

man명령 사용시 색깔 지정. (안시코드 참조)

export LESS_TERMCAP_mb=$‘\E[01;31m’
export LESS_TERMCAP_md=$‘\E[01;36m’
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’

–color=auto로 되어 있으면 파이프로 연결시 색깔이 안나옵니다.

예를들어 ls|more하면 색이 안나옴

alias ls=‘/bin/ls --color=yes’
alias dir=‘/bin/dir --color=yes’
alias vdir=‘/bin/vdir --color=yes’

alias grep=‘/bin/grep --color=yes’
alias fgrep=‘/bin/fgrep --color=yes’
alias egrep=‘/bin/egrep --color=yes’

less의 경우 -R옵션이 없으면 색깔이 나오지 않습니다.

alias less=‘/bin/less -R’