This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Default color codes for Konsole text

Tags: None
(comma "," separated)
RCD
Registered Member
Posts
2
Karma
0
What to the various text colors in Konsole signify? Files listed with ls have various colors. Some are fairly obvious. For instance, with the ls command directories (folders) are blue, ordinary files are black. That is pretty clear. Some files are in red. What does that mean? some files are sort of purple; they appear to be graphics files of one sort or another. Is there a list of what the default text colors for Konsole? Is Konsole applying those colors, or is that a function of ls?
wolfi323
Registered Member
Posts
1129
Karma
11
OS
RCD wrote:Is there a list of what the default text colors for Konsole? Is Konsole applying those colors, or is that a function of ls?

It's a function of ls.

Have a look at "man dir_colors"... ;)

The colors are defined in /etc/DIR_COLORS, and can be overridden on a per-user basis in ~/.dir_colors.
RCD
Registered Member
Posts
2
Karma
0
Thank you for your assistance. I am running Linux Mint KDE 17.1 which doesn't seem to have a /etc/DIR_COLORS file, but your information that the color coding is done by ls rather than konsole led me to the answer.

I found the coding in /etc/bash.bashrc where there was a line that starts, "LS_COLORS=". That line and contains a string of color codes associating colors with varius different file types.

At http://askubuntu.com/questions/466198/h ... he-console I found definitions for the file type and color codes used in bash.bashrc

Thank you again.
wolfi323
Registered Member
Posts
1129
Karma
11
OS
RCD wrote:I found the coding in /etc/bash.bashrc where there was a line that starts, "LS_COLORS=". That line and contains a string of color codes associating colors with varius different file types.

Yes, ls does take the colors from $LS_COLORS in the end.
But dircolors can be used to set this environment variable.

From the dir_colors man page:
Code: Select all
      The  program ls(1) uses the environment variable LS_COLORS to determine
       the colors in which the filenames are to be displayed.   This  environ-
       ment variable is usually set by a command like

              eval `dircolors some_path/dir_colors`

       found  in a system default shell initialization file, like /etc/profile
       or /etc/csh.cshrc.  (See also dircolors(1).)  Usually,  the  file  used
       here  is /etc/DIR_COLORS and can be overridden by a .dir_colors file in
       one's home directory.


Here on openSUSE, dircolors is run in /etc/profile.d/ls.bash.

As dircolors is also part of coreutils (like ls), I thought this would be used by every distribution by default...
(the link you posted does mention it too)


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]