OS & Shell/Linux
[Linux] bash color 확인
냐옴
2017. 5. 23. 16:59
아래 코드를 bash 에서 실행
echo &&
echo -e "\e[39m39 Foreground Default foreground color\e[0m" &&
echo -e "\e[30m30 Foreground Black\e[0m" &&
echo -e "\e[31m31 Foreground Red\e[0m" &&
echo -e "\e[32m32 Foreground Green\e[0m" &&
echo -e "\e[33m33 Foreground Yellow\e[0m" &&
echo -e "\e[34m34 Foreground Blue\e[0m" &&
echo -e "\e[35m35 Foreground Magenta\e[0m" &&
echo -e "\e[36m36 Foreground Cyan\e[0m" &&
echo -e "\e[37m37 Foreground Light gray\e[0m" &&
echo -e "\e[90m90 Foreground Dark gray\e[0m" &&
echo -e "\e[91m91 Foreground Light red\e[0m" &&
echo -e "\e[92m92 Foreground Light green\e[0m" &&
echo -e "\e[93m93 Foreground Light yellow\e[0m" &&
echo -e "\e[94m94 Foreground Light blue\e[0m" &&
echo -e "\e[95m95 Foreground Light magenta\e[0m" &&
echo -e "\e[96m96 Foreground Light cyan\e[0m" &&
echo -e "\e[97m97 Foreground White\e[0m" &&
echo -e "\e[49m49 Background Default background color\e[0m" &&
echo -e "\e[40m40 Background Black\e[0m" &&
echo -e "\e[41m41 Background Red\e[0m" &&
echo -e "\e[42m42 Background Green\e[0m" &&
echo -e "\e[43m43 Background Yellow\e[0m" &&
echo -e "\e[44m44 Background Blue\e[0m" &&
echo -e "\e[45m45 Background Magenta\e[0m" &&
echo -e "\e[46m46 Background Cyan\e[0m" &&
echo -e "\e[47m47 Background Light gray\e[0m" &&
echo -e "\e[100m100 Background Dark gray\e[0m" &&
echo -e "\e[101m101 Background Light red\e[0m" &&
echo -e "\e[102m102 Background Light green\e[0m" &&
echo -e "\e[103m103 Background Light yellow\e[0m" &&
echo -e "\e[104m104 Background Light blue\e[0m" &&
echo -e "\e[105m105 Background Light magenta\e[0m" &&
echo -e "\e[106m106 Background Light cyan\e[0m" &&
echo -e "\e[107m107 Background White\e[0m" &&
echo
컬러 구간 표기
컬러 시작 :
- \e[컬러숫자m
- \x1B[컬러숫자m
컬러종료 :
- \e[0m
- \e[39m
- \x1B[0m
- \x1B[39m
echo &&
echo -e "Foreground \e[31m 31 Red \e[0m Color" &&
echo -e "Foreground \e[31m 31 Red \e[39m Color" &&
echo -e "Foreground \x1B[31m 31 Red \x1B[0m Color" &&
echo -e "Foreground \x1B[31m 31 Red \x1B[39m Color" &&
echo
참고
http://misc.flogisoft.com/bash/tip_colors_and_formatting
bash:tip_colors_and_formatting - FLOZz' MISC
Bash tips: Colors and formatting (ANSI/VT100 Control sequences) The ANSI/VT100 terminals and terminal emulators are not just able to display black and white text ; they can display colors and formatted texts thanks to escape sequences. Those sequences are
misc.flogisoft.com
https://dev.to/ifenna__/adding-colors-to-bash-scripts-48g4
Adding colors to Bash scripts
I recently wrote a post-receive git hook for a server and I wanted to easily distinguish my hook's ou...
dev.to