shell 字体输出颜色及终端格式控制

#字体色30-37
echo -e "\033[30m黑色字\033[0m"
echo -e "\033[31m红色字\033[0m"
echo -e "\033[32m绿色字\033[0m"
echo -e "\033[33m黄色字\033[0m"
echo -e "\033[34m蓝色字\033[0m"
echo -e "\033[35m紫色字\033[0m"
echo -e "\033[36m天蓝字\033[0m"
echo -e "\033[37m白色字\033[0m"

#字背景颜色范围:40-47
echo -e "\033[40;37m黑底白字\033[0m"
echo -e "\033[41;30m红底黑字\033[0m"
echo -e "\033[42;34m绿底蓝字\033[0m"
echo -e "\033[43;34m黄底蓝字\033[0m"
echo -e "\033[44;30m蓝底黑字\033[0m"
echo -e "\033[45;30m紫底黑字\033[0m"
echo -e "\033[46;30m天蓝底黑字\033[0m"
echo -e "\033[47;34m白底蓝字\033[0m"

#控制选项说明
#\033[0m关闭所有属性
#\033[1m设置高亮度
#\033[4m下划线
echo -e "\033[4;31m下划线红字\033[0m"
#闪烁
echo -e "\033[5;34m红字在闪烁\033[0m"
#反影
echo -e "\033[8m消隐\033[0m "

posted @ 2018-07-19 17:48  xiao913  阅读(229)  评论(0编辑  收藏  举报