PDA

View Full Version : [SOLVED] directories,files see different colors in names



chris1950
August 17th, 2009, 03:15 PM
when I did the command ( ls) I have seen directory names in different colors - Red, Green, Blue. Can someone tell me what they mean or where can I find out what these colors mean?

tarps87
August 17th, 2009, 04:17 PM
They relate the file type, buy default the colours are blue = directory, black = file cyran = link.
They also relate to permissions and can very between themes.

Try using ls -l

You will see something like this:

lrwxrwxrwx 1 root root 30 2009-04-28 14:40 vmlinuz

l = type (l = link, d = directory, - = file)

rwxrwxrwx = permssions

1st three = user/ owner
2nd three = group
3rd three = other

r = read
w = write
x = execute

Edit:

some more info
http://wiki.linuxquestions.org/wiki/Ls

Paddy Landau
August 17th, 2009, 04:30 PM
I have an answer, but sorry, it's not straightforward.

Enter the command man ls to see the instructions. Search for 'color'. You'll find that it refers to dircolor.

Enter the command man dircolor to see the instructions for dircolor. You'll see that it refers to the --print-database option.

Enter the command dircolor --print-database to see the list of colours.

All you need now is to decode the codes for the ANSI colour scheme (e.g. 01;35 means magenta).

http://rrbrandt.comli.com/docs/tut/redes/ansi.php
http://www.termsys.demon.co.uk/vtansi.htm
http://en.wikipedia.org/wiki/ANSI_escape_code

Good luck!

chris1950
August 18th, 2009, 05:59 AM
I am refering to the Directory name colors - I had problems accessing one and when I changed permissions the color changed. What I wanted to know was what each color means/stands for. Where can I get this information.

lloyd_b
August 18th, 2009, 08:14 AM
I am refering to the Directory name colors - I had problems accessing one and when I changed permissions the color changed. What I wanted to know was what each color means/stands for. Where can I get this information.

Take a look here (http://blog.alexrybicki.com/2009/03/bash-ls-color-meaning.html). If you run the script from that page, it will show you the color setup for every type of file that "ls" recognizes and displays in color.

Lloyd B.

chris1950
August 18th, 2009, 11:33 AM
Thanks, just what I was looking for.