trapd00r/LS_COLORS

dircolors command not found

slugb0t opened this issue · 9 comments

followed the instructions for bash on my OSX terminal and when source .bash_profile was ran it gave me the following output. I have my bash_profile and bashrc to sync together so i know the eval function was placed in bashrc but there shouldn't be an issue when it comes to it being in bash_profile or bashrc.
If anyone has an idea on how to fix this I would greatly appreciate it

it gave me the following output.

Did you forget to add the output?

thank you for a response but what output are you talking about specifically?
instructions didn't tell me to add anything
i just used the wget function given to install everything

You said "it gave me the following output" so I was talking about that, since I don't see anything like that following this.

ahh i see what you mean, the title was the output that was given to me "bash - dircolors command not found"

so i managed to fix the "-bash: dircolors: command not found" issues
my problem was not having coreutils so i brew installed it and added it to my path and ran source .bash_profile and that issue went away!
though the issue is now when i source .bash_profile nothing seems to happen with ls
everything is still by default the same
any suggestions?

try switching from dircolors to gdircolors

edit: typo

@slugb0t, you are almost there! Now that you have coreutils installed, you need to make sure gdircolors sets the environment variable LS_COLOR when you terminal is initialized. To do so, add the following line to your .bash_profile: eval $(gdircolors "$HOME/.dircolors")

Now source your .bash_profile again and run: gls --color in your home folder. You should see a colorful output.

I replaced my standard ls with an alias by adding this extra line to my .bash_profile: alias ls='gls -F --color'

Why does switching from dircolors to gdircolors fix this issue?

macOS ships BSD variants of many posix utilities, which behave differently than the GNU versions commonly shipped with most linux distributions.