Tuesday, December 5, 2023
rated 0 times [  3] [ 0]  / answers: 1 / hits: 1096  / 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


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 ]
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'

[#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.

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

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