表示に関するエスケープシーケンス(bash)
文字の色
$ echo -e "color (\e[30mTEXT\e[0m)"color (TEXT)$ echo -e "color (\e[31mtTEXTt\e[0m)"color (TEXT)$ echo -e "color (\e[32mTEXT\e[0m)"color (TEXT)$ echo -e "color (\e[33mTEXT\e[0m)"color (TEXT)$ echo -e "color (\e[34mTEXT\e[0m)"color (TEXT)$ echo -e "color (\e[35mTEXT\e[0m)"color (TEXT)$ echo -e "color (\e[36mTEXT\e[0m)"color (TEXT)$ echo -e "color (\e[37mTEXT\e[0m)"color (TEXT)$ R=1; G=3; B=5; \
> V=$(($R * 36 + $G * 6 + $B + 16)); \
> echo -e "color (\e[38;5;${V}mTEXT\e[0m)" \
> # R,G,B は 0..5 までの整数color (TEXT)
背景の色
$ echo -e "color (\e[40mTEXT\e[0m)"color (TEXT)$ echo -e "color (\e[41mTEXT\e[0m)"color (TEXT)$ echo -e "color (\e[42mTEXT\e[0m)"color (TEXT)$ echo -e "color (\e[43mTEXT\e[0m)"color (TEXT)$ echo -e "color (\e[44mTEXT\e[0m)"color (TEXT)$ echo -e "color (\e[45mTEXT\e[0m)"color (TEXT)$ echo -e "color (\e[46mTEXT\e[0m)"color (TEXT)$ echo -e "color (\e[47mTEXT\e[0m)"color (TEXT)$ R=1; G=3; B=5; \
> V=$(($R * 36 + $G * 6 + $B + 16)); \
> echo -e "color (\e[48;5;${V}mTEXT\e[0m)" \
> # R,G,B は 0..5 までの整数color (TEXT)
その他
\e[2J
… 画面のクリア