linux shell设置颜色

使用echo或者printf时,可以添加输出文本的颜色设置

echo -e "Maximum e[1;31m" $max_threads "e[0mthreads allowed!" >> $term_dir/summary

或者

printf("33[;34mfile33[0m")

 awk 参考:http://stackoverflow.com/questions/14482101/awk-adding-color-code-to-text

31开始代表前景色, 41开始代表背景色,至于具体颜色取决于当前shell的设置

原文地址:https://www.cnblogs.com/long123king/p/3760610.html