I have a Ubuntu server (18.04) that rebuilds itself on a schedule. Every once in a while on a fresh install, all the console text color will be a different color. Usually it's white on black, but sometimes its blue, green, or red (and maybe others, I can't remember). There doesn't seem to be anything obvious to link it to (bad install, etc).

Is the color there for a reason? What determines what color the text will be?

  • To clarify: The color is not just when running ls or another command. all of the text is a different color (even MOTD, login banner, prompt, etc.). – cawwot Jul 9 '18 at 13:56

When you write something in terminal, it's in white. If you use the ls command for showing the content of a directory, each color represents a specific type of file.

Color of files on 'ls' command:

  • Executable files: Green

  • Directory: Blue

  • Image files(jpg, gif, bmp, png, tif): Magenta
  • Symbolic links: Cyan
  • Pipe: Yellow
  • Socket: Magenta
  • Orphaned symbolic links: Blinking Bold white with red background
  • Block device driver: Bold yellow foreground, with black background
  • Missing links along with files they point to: Blinking Bold white with red background
  • Archives or compressed files(like tar,gz,zip,rpm): Red


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.