Add Color to your Prompt Linux Bash Shell



Add Color to your Prompt Linux Bash Shell

Add Color to your Prompt Linux Bash Shell

You can add color to your prompt and give your Linux bash shell a real lift. We will show you in this tutorial how you can add color to the PS1 prompt in the Linux bash shell. Making it easier to read and focus on what you want. Not stopping there we will pimp your bash scripts also, adding color to their output to really add interest and flair

The BASH color codes:
export red=”33[1;31m”
export green=”33[1;32m”
export yellow=”33[1;33m”
export blue=”33[1;34m”
export purple=”33[1;35m”
export cyan=”33[1;36m”
export grey=”33[0;37m”
export reset=”33[m”

source ~/.color
export PS1=”${cyan}u@h ${grey}w ${cyan}$ $reset”

for f in file1 file2 file3 ; do
if [ -e $f ] ; then
echo -e “${green}$f exists!${reset}”
else
echo -e “${red}$f does not exist!${reset}”
fi
done

Additionally you can find my video courses on Pluralsight: http://pluralsight.com/training/Authors/Details/andrew-mallett and take time to see my own site http://www.theurbanpenguin.com

-~-~~-~~~-~~-~-
Please watch: “RHCSA 9 Working With Podman Containers”
https://www.youtube.com/watch?v=piwcpd_hWn0
-~-~~-~~~-~~-~-

Comments are closed.