I am trying to set the directory colors in alpine to be white.

I tried to create ~/.profile with LS_COLORS=$LS_COLORS:'di=1;44:' ; export LS_COLORS in it. But it had no effect.

I see many examples out there for doing this in BASH. But Alpine uses SH.

How can I change the color of directories in Alpine?

  • Are you sure that ls in Alpine respects LS_COLORS? Can you set that manually in the shell after you log in and see the expected color change? – Andy Dalton Jan 9 at 20:53

Alpine uses SH.

Incorrect. Alpine Linux uses BusyBox, and the Almquist shell variant that is part of BusyBox.

Which is the root of the issue. BusyBox ls in recent versions has a --color option, which is documented in its user manual (q.v.). Its colour choices are hardwired into the program, and not configurable with an environment variable.

If you really want an ls command with colours that you can configure with an environment variable, you will have to install some other ls command.

Further reading

  • huh. OK. I did not know that. I assumed it was sh because when I connect to it I launch /bin/sh. Either way, it sounds like I have to run ls --color=never each time I want to see the directories. – Vaccano Jan 9 at 22:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.