Find the answer to your Linux question:
Results 1 to 8 of 8
Hi why files change their colors when we change their permissions? the permission of my test file was: $ll -rw-r--r-- 1 iman iman 9 Jul 27 14:54 test and it's ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2004
    Location
    Iran
    Posts
    20

    why files change their colors when we .... ?


    Hi
    why files change their colors when we change their permissions?
    the permission of my test file was:
    $ll
    -rw-r--r-- 1 iman iman 9 Jul 27 14:54 test
    and it's color was black. but when i changed it to -rwxr--r-- it becamed green(I mean the color of the file when we use ll command to show it in console). I know that this is beacuse of X (excute)permission .but why? what do colors mean in console?
    Is there any man page that explane about the colors of the files ... ?
    thanks for your attention

  2. #2
    Linux Engineer
    Join Date
    May 2003
    Location
    Greece / Athens
    Posts
    1,169
    i think when the file color is red access is denied,green means it is executable and black that is not ....
    Linux For Ever!

  3. #3
    Linux Newbie
    Join Date
    May 2004
    Location
    Boston, MA
    Posts
    246
    In Debian at least, the default colors for ls are:

    blue = directory
    black = regular, non-executable file
    green = executable file (executable bit is set for your user)
    red = archive
    pink = image or movie or something (not sure what the rules on this one are)
    light blue = symbolic link
    red with black background = broken symbolic link

    Hope this helps.
    Situations arise because of the weather,
    And no kinds of love are better than others.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Newbie
    Join Date
    Jul 2004
    Location
    www.syracuse.com
    Posts
    119
    mess around with the $PS1 variable to change color setting, and how your terminal looks. ibm offers tons of awesome tutorials.

    http://www-106.ibm.com/developerwork...mpt/index.html

  6. #5
    Just Joined!
    Join Date
    Jul 2004
    Location
    Iran
    Posts
    20
    so thanks for your attentin hafnium,dan@george and stathisx
    by the way stathisx: your link was really killer

  7. #6
    Linux Guru sarumont's Avatar
    Join Date
    Apr 2003
    Location
    /dev/urandom
    Posts
    3,682
    Code:
    cat /etc/DIR_COLORS
    This file will tell you what color is for what file ext., etc.
    "Time is an illusion. Lunchtime, doubly so."
    ~Douglas Adams, The Hitchhiker's Guide to the Galaxy

  8. #7
    Just Joined!
    Join Date
    Jul 2004
    Location
    Iran
    Posts
    20
    I tested **cat /etc/DIR_COLORS** but there was not such dir . maybe beacuse my distro is knoppix. isn't it?

  9. #8
    Linux Guru sarumont's Avatar
    Join Date
    Apr 2003
    Location
    /dev/urandom
    Posts
    3,682
    Maybe...I thought that was the default for all distros...try ~/.dir_colors

    "Time is an illusion. Lunchtime, doubly so."
    ~Douglas Adams, The Hitchhiker's Guide to the Galaxy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •