Monday, March 23, 2026

macos – Find out how to set customized colorizing of “ls” output in Zsh?

Again when dinosaurs roamed the earth and macOS used bash, I had the next traces in my .bash_profile:

# Set LS_COLORS
LS_COLORS='di=00;34:fi=00;0:ln=00;96:pi=00;37:so=00;37:bd=00;37:cd=00;37:or=00;93:mi=00;94:ex=00;31:*.tar=00;90:*.tgz=00;90:*.gz=00;90:*.awk=00;35:*.sed=00;33'
export LS_COLORS

# Prettify and streamline listings
alias ls="ls --color=auto"
alias ll="ls -l"
alias la="ls -a"
alias lla="ls -al"
alias lF='ls -F'
alias laF='ls -laF'
alias llF='ls -lF'
alias llaF='ls -alF'

That gave me the colorized output I wished with the customized colours I wished.

I’ve been attempting with out success to get the identical look in Zsh.

That is what I’ve in my .zprofile:

# Set LS_COLORS
LS_COLORS='di=00;34:fi=00;0:ln=00;96:pi=00;37:so=00;37:bd=00;37:cd=00;37:or=00;93:mi=00;94:ex=00;31:*.tar=00;90:*.gz=00;90:*.awk=00;35:*.sed=00;33:*.py=00;93'
export CLICOLOR=1

# Prettify and streamline listings
alias ls="ls -G"
alias ll="ls -lG"
alias la="ls -aG"
alias lla="ls -alG"
alias lf="ls -FG"
alias laf="ls -laFG"
alias llf="ls -lFG"
alias llaf="ls -alFG"

Nonetheless, this isn’t working.

Directories do present up listed in purple, however particular person .awk, .sed or .py information don’t present up in something besides the default colour. I’ve tried altering the surroundings variable LS_COLORS to be LSCOLORS as I learn that macOS makes use of that title.

It didn’t assist.

I’ve additionally checked out numerous web sites ensuing from a DuckDuckGo search however all of them are both old-fashioned (referring to bash) or particular to GNU or some specific Linux taste resembling Ubuntu. The Mac-specific websites I checked out all seem to say that setting LSCOLOR or LS_COLORS and having the road export CLICOLOR=1 in my .zprofile will work.

What am I doing improper?

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles