Tuesday, April 30, 2024
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 1163  / 2 Years ago, tue, april 12, 2022, 2:22:19

enter image description hereI accidentally delete/change LS colors when listing directories with the 'ls' command, so I tried the command "ls --color=auto" it works temporarily because when I reboot my terminal ls colors return to just white.


More From » command-line

 Answers
7

By default, your ~/.bashrc contains a section that defines the ls and grep commands to run in color mode.


The default .bashrc configuration file can be found in the directory /etc/skel, and from here you can take the relevant section and add it back to your ~/.bashrc to restore the default behavior with color support:


# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]
then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'

alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi

[#1072] Thursday, April 14, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
giccolla

Total Points: 161
Total Questions: 124
Total Answers: 117

Location: Aland Islands
Member since Wed, Nov 17, 2021
3 Years ago
giccolla questions
;