15

I looked through the documentation of Putty but couldn't find the answer. What do the different colors on files and folders signify?

0

8 Answers 8

27

It's not putty - run the dircolors -p command it will tell you what color maps to each known file type.

1
  • 2
    +1 for dircolors -p.
    – jscott
    Oct 28, 2010 at 15:13
20

It's not puTTY that does the coloring, it's likely dircolors. The specific will vary from distro-to-distro but you can get a good idea of how this works from man dircolors

For instance on my Debian install:

  • Directories -> Dark blue
  • Symlinks -> Cyan

You can also try echo $LS_COLORS to see what's stored in there. You will see the coloring rules in this variable.

3
  • Well, aside from that technicality, what do the colors represent?
    – kylex
    Oct 28, 2010 at 15:02
  • 2
    @kylex - The answer depends on your configuration. I'm almost certain the colors aren't defined in any standard, so it could vary from machine to machine.
    – voretaq7
    Oct 28, 2010 at 15:05
  • 1
    @kylex - voretaq is correct, it varies based on configuration. See iain's answer for how to check your config without mucking in /etc/dircolors or shell variables.
    – jscott
    Oct 28, 2010 at 15:18
3

This is from askubuntu.com by karthick87 (link)

Info

Run this when you're connected to a linux host and it'll output the colour scheme. Tested on Ubuntu 16.04 and CentOS 7.

Bash script

eval $(echo "no:global default;fi:normal file;di:directory;ln:symbolic link;pi:named pipe;so:socket;do:door;bd:block device;cd:character device;or:orphan symlink;mi:missing file;su:set uid;sg:set gid;tw:sticky other writable;ow:other writable;st:sticky;ex:executable;"|sed -e 's/:/="/g; s/\;/"\n/g')           
{      
  IFS=:     
  for i in $LS_COLORS     
  do        
    echo -e "\e[${i#*=}m$( x=${i%=*}; [ "${!x}" ] && echo "${!x}" || echo "$x" )\e[m" 
  done       
} 

Example output

Screenshot_OCT17

2

You are looking in the wrong place: Putty is a terminal emulator, it simply displays the colors the machine you're connected to sends it.
I assume you're using a *NIX-style system, so check the manpage for ls (if it's a Linux box, the man page for dircolors explains a command that lets you set up those colors).

2

This doesn't really have anything to do with PuTTy, it's your shell that makes different types of files/directories appear in different colours. This is done via an environment variable called LS_COLORS and the exact contents of LS_COLORS are usually determined by dircolors, which is typically called by a .profile file, etc., depending on what OS you are using.

Here's a great write-up on this.

0

It may be Putty, and it may be your shell. You can verify by running Putty.exe and going to Configuration->Window->Colours. Looks at what the colors are that Putty is configured to display. Also, at the top, if you're allowing the terminal to specify colors, you should check your shell to see if it is specifying colors, like Bash can.

0

Its just in Putty, in the active putty window, right click on the title bar, click on settings, in putty reconfiguration window, click on colours in window option and uncheck all options and APPLY. it will now show only black and white colors!

1
  • 2
    The question is not about disabling colors, it's figuring out what each color represents. Also - this question is one year old, and answered a long time ago..
    – pauska
    Oct 7, 2011 at 11:43
0

My working version that works both on Mac OS and Ubuntu.

Stuff the following three lines into this file: ~/.bash_profile (<== This file should be on the server, or the machine that you are SSH-ing.)

export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad

Source: http://osxdaily.com/2013/02/05/improve-terminal-appearance-mac-os-x/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .