Thursday, May 23, 2024
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1337  / 2 Years ago, wed, may 18, 2022, 10:02:18

I am new to Linux OS. I was trying to add custom colors to my terminal using LS_Colors Project on Github

I installed the package using sh from the repo.

And it says, To enable the colors, add the following line to your shell's start-up script:

For Bourne shell (e.g. ~/.bashrc or ~/.zshrc):

  . "/home/username/.local/share/"

How and where do I edit that script?

This is my bashrc file

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/username/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
if [ -f "/home/username/anaconda3/etc/profile.d/" ]; then
. "/home/username/anaconda3/etc/profile.d/"
export PATH="/home/username/anaconda3/bin:$PATH"
unset __conda_setup
# <<< conda initialize <<<

More From » command-line


From terminal run:

echo '. "/home/abi/.local/share/"' >> ${HOME}/.bashrc

This assumes that your user uses default shell on Ubuntu which is bash.

For other shells you need to find out proper initialization file location.

man {shell name}


man zsh

After you add this line to your shell initialization script make sure you re-read this file, in case of bash invoke:

. ${HOME}/.bashrc

This solution can be improved still, i.e. you should check if lscolors initialization file exist before you source it in your shell's initialization file, to do that you should open your shell's initialization file in your favorite text editor (geany/gedit/nano/vim/emacs) and add following lines:

if [ -f "${HOME}/.local/share/" ] ; then
. "${HOME}/.local/share/"

[#2184] Thursday, May 19, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 1
Total Questions: 112
Total Answers: 114

Location: Lesotho
Member since Wed, Jun 2, 2021
3 Years ago
girdleas questions