Linux ls Colour-coding in PuTTY CodeUnit 05 NOV 2009

PuTTY is a damn useful app for when it comes to gaining remote access into a machine via SSH or Telnet, and has more than proven its worth to serious geeks over the years since it was first released.

But here’s a question that you’ll be asking if you are new to the whole command line SSH into Linux access thing:

“Just what does all the colour-coding (when it comes to folder listings) displayed in PuTTY mean?”

Well, basically the colour-coding is to expediate file type recognition. For example, the default colour set is as follows (thanks Google!):

  • * Normal file: White (or the default colour used by the command line window)
  • * Directory: Blue
  • * Symbolic link: Cyan
  • * Pipe: Yellow
  • * Socket: Magenta
  • * Block device driver: Bold yellow foreground, with black background
  • * Character device driver: Bold yellow foreground, with black background
  • * Orphaned syminks: Blinking Bold white, with red background
  • * Missing links: Blinking Bold white, with red background
  • * Archives or compressed files: Red (e.g. .tar, .gz, .zip, .rpm)
  • * Image files: Magenta (.jpg, gif, bmp, png, tif)

To manipulate or view just what colours your system is spitting out you, simply pay a visit to /etc/profile.d/colors.sh and /etc/profile.d/colors.csh

There, hope that helps! :)

(Tip: If you wish to disable the list colouring, simply remove the alias that attaches ls –color=tty to ls – run `alias` to see what I’m referring to.)

Related Posts:

About Craig Lotter

Software developer, husband and dad to two little girls. Writer behind An Exploring South African. I don't have time for myself any more.

  • Color enabled command shells really make a difference, you just notice it when you come at a black and white only one.
    .-= Nathan Rodriguez´s last blog ..Seguro de Transporte =-.

  • Color enabled command shells really make a difference, you just notice it when you come at a black and white only one.
    .-= Nathan Rodriguez´s last blog ..Seguro de Transporte =-.

  • Absolutely! The visual aid the colouring provides is fantastic. Allows your eye to instantly pick out the various files, folders and symlinks…

  • Absolutely! The visual aid the colouring provides is fantastic. Allows your eye to instantly pick out the various files, folders and symlinks…

  • Great blog, I am new to this and the colour coding was confusing. Your explain really well so much appreciated.

  • Thanks for posting this Craig. I have been getting so frustrated with the colour coding and I wasn't able to find any articles or blogs that explained so this has come at the right time! I'll try to use that code you've posted up and see how it goes.