The default terminal settings on most linux systems is to use colors to serve as hints about file types and permissions. For example, you’ll see directory names in blue, executables in green, and file archives in red. And, if you don’t want to see the colors — like when they’re just too distracting, you can turn them off easily. The command line colors are set when the ls command is aliased to an ls command that uses the –color option like this: alias ls='ls --color=auto' To turn off font colors for some period of time, you can just turn off the alias. $ unalias ls To turn off font colors all of the time, you can put the unalias command in your ~/.bashrc file or remove the alias command that sets it up in the first place, though that might be in your ~/.bashrc file or some system file. You can also make individual changes to your font color palette. Say you don’t like seeing blue as the font color that displays the names of directories. Maybe your background color is a close blue. You can change the color used for just directories with a command like this: LS_COLORS=$LS_COLORS:'di=35:' ; export LS_COLORS So, where did that come from? The di in that command signifies directories. It and other particular file types that you can specify are listed here: di = directory fi = file ln = symbolic link pi = fifo file so = socket bd = block (buffered) special file cd = character (unbuffered) special file or = symbolic link pointing to a nonexistent file mi = non-existent file pointed that a symbolic link points out (showing up in the long listing) ex = an executable file *.rpm = files with the ending .rpm The 35 in the command indicates the color — 35 means purple. Some of the options in the list below can be combined. For example, you could use a purple font with a green background if you use di=35;42. Here is a list of your options, though I have to admit to some of these color combinations combined with flashing would probably make me dizzy. 0 = default colour 1 = bold 4 = underlined 5 = flashing text 7 = reverse field 31 = red 32 = green 33 = orange 34 = blue 35 = purple 36 = cyan 37 = grey 40 = black background 41 = red background 42 = green background 43 = orange background 44 = blue background 45 = purple background 46 = cyan background 47 = grey background 90 = dark grey 91 = light red 92 = light green 93 = yellow 94 = light blue 95 = light purple 96 = turquoise 100 = dark grey background 101 = light red background 102 = light green background 103 = yellow background 104 = light blue background 105 = light purple background 106 = turquoise background Another cute trick that I picked up online is making the color of your prompt change depending on whether the command you just entered completed successfully or not. This trick uses some of what we’ve seen above (e.g., selecting the right font colors), but adds a function to your ~/.bashrc file that formats your prompt after evaluating the exit status of your last command. Add a function like this to your ~/.bashrc file and your prompt will go from green (normal) to red (something is wrong) when you type a command that fails for some reason. function exstat { EXSTAT="$?" RED="[ Related content how-to Compressing files using the zip command on Linux The zip command lets you compress files to preserve them or back them up, and you can require a password to extract the contents of a zip file. By Sandra Henry-Stocker May 13, 2024 4 mins Linux opinion NSA, FBI warn of email spoofing threat Email spoofing is acknowledged by experts as a very credible threat. By Sandra Henry-Stocker May 13, 2024 3 mins Linux how-to The logic of && and || on Linux These AND and OR equivalents can be used in scripts to determine next actions. By Sandra Henry-Stocker May 02, 2024 4 mins Linux how-to Using the apropos command on Linux By Sandra Henry-Stocker Apr 24, 2024 3 mins Linux PODCASTS VIDEOS RESOURCES EVENTS NEWSLETTERS Newsletter Promo Module Test Description for newsletter promo module. Please enter a valid email address Subscribe