Where are LS_COLORS set by default in RHEL 5.x?

In a terminal on Red Hat Enterprise Linux 5.x, it runs:

[$] Env

returns (by the way):

"LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33 . . ."

Most of the content in LS_COLORSI will find in the file:

/etc/DIR_COLORS

BUT the meaning of " no=00:fi=00:di=01;34:ln=01;36:pi=40;33etc.", I did not find success, even after grepping through the system.

In which file (s) are these values ​​indicated?

Yes, I know that I can set the content LS_COLORSto the values ​​that I like, but what I ask about is where the above values ​​are.

+3
source share
3 answers

I think what you are looking for can be found on /etc/profile.d/colorls.sh:

# color-ls initialization

alias ll='ls -l' 2>/dev/null
alias l.='ls -d .*' 2>/dev/null

COLORS=/etc/DIR_COLORS
[ -e "/etc/DIR_COLORS.$TERM" ] && COLORS="/etc/DIR_COLORS.$TERM"
[ -e "$HOME/.dircolors" ] && COLORS="$HOME/.dircolors"
[ -e "$HOME/.dir_colors" ] && COLORS="$HOME/.dir_colors"
[ -e "$HOME/.dircolors.$TERM" ] && COLORS="$HOME/.dircolors.$TERM"
[ -e "$HOME/.dir_colors.$TERM" ] && COLORS="$HOME/.dir_colors.$TERM"
[ -e "$COLORS" ] || return

eval `dircolors --sh "$COLORS" 2>/dev/null`
[ -z "$LS_COLORS" ] && return

if ! egrep -qi "^COLOR.*none" $COLORS >/dev/null 2>/dev/null ; then
        alias ll='ls -l --color=tty' 2>/dev/null
        alias l.='ls -d .* --color=tty' 2>/dev/null
        alias ls='ls --color=tty' 2>/dev/null
fi

LS_COLORS dircolors --sh "$COLORS" 2>/dev/null, , , /etc/DIR_COLORS. , LS_COLORS DIR_COLORS.

, dircolors --sh "$COLORS":

$ dircolors --sh "$COLORS" 
LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:';
export LS_COLORS

echo $LS_COLORS:

$ echo $LS_COLORS
no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:

.

+7
  /etc/DIR_COLORS 

.

 /etc/DIR_COLORS.xterm.

SSH

/etc/DIR_COLORS.xterm 

.

+3

manpage dircolors::

FILE , , . , . , `dircolors --print- .

,

0

Source: https://habr.com/ru/post/1704279/


All Articles