By Bill R

2019-02-11 00:25:23 8 Comments

I teach an Intro to UNIX/Linux course at a local college and one of my students ask the following question:

Why are some of the files in my directory colored white and others are gray? Are the white ones the ones I created today and the gray are existing files?

As I looked into this I first thought the answer would be in the LS_COLORS variable but further investigation revealed that the color listings were different when using the '-l' switch verses the '-al' switch with the ls command. See the following screen shots:

using ls -l the file named '3' shows as white

using the -al switch the same file shows a gray

using ls -l the file named '3' shows as white but using the -al switch the same file shows a gray.

Is this a bug in ls or does anyone know why this is happening?


@Thomas Dickey 2019-02-11 00:48:03

It looks as if your prompt-string ($PS1) is setting the bold attribute on characters to make the colors nicer, and not unsetting it. The output from ls doesn't know about this, and does unset bold. So after the first color output of ls, everything looks dimmer.

@Bill R 2019-02-11 19:09:36

Yep, that was it. Last color change in $PS1 set bold+white (1;37) -- Thanks!

@Thomas Dickey 2019-02-12 00:13:43

You can mark it accepted, then.

Related Questions

Sponsored Content

2 Answered Questions

[SOLVED] Filter output of command by color

2 Answered Questions

[SOLVED] Unable to set LS_COLORS in bash using script

2 Answered Questions

[SOLVED] Alternate prompt, command, and output color

  • 2018-06-16 16:22:21
  • Austin Weaver
  • 138 View
  • 2 Score
  • 2 Answer
  • Tags:   terminal colors

1 Answered Questions

[SOLVED] Different vim colors and styles in Tmux and Gnome

3 Answered Questions


0 Answered Questions

Strange Highlighting Color In ZSH Menu

1 Answered Questions

[SOLVED] Why root bash output is colored but `sudo ls` output is not?

1 Answered Questions

[SOLVED] Using NVIDIA instead of Intel causes a different theme

3 Answered Questions

[SOLVED] Preserving color output with cut

1 Answered Questions

[SOLVED] Is there a Vim syntax file for ANSI-colored output of CLI apps?

Sponsored Content