zsh: How to set LS_COLOR to show any tar file as different color than white?

I am using zsh

When I do ls: for any compressed file type such as .tar.gz, .tbz2, .zip I get them as white and not bold.On the other hand, in bash its color is red and in bold.

Is it possible to give different color than white to any compressed file type in zsh?

$ ls --version
ls (GNU coreutils) 8.30

I have following setup in me .zshrc file:

export CLICOLOR=1
export LS_COLORS="$LS_COLORS:ow=1;34:tw=1;34:"
export LSCOLORS=ExGxBxDxCxEgEdxbxgxcxd
ls: aliased to ls -h --color=always -v --author --time-style=long-iso

When I remote connect to a machine default in zsh shell tar files’ color is white. Than I switch to bash and switch bach to zsh, then its color is changed back to red. Is it possible to have to behavior by default in zsh?

enter image description here

Asked By: alper


Based on your comment, your $LS_COLORS doesn’t include any compressed files, or any file extensions at all for that matter.


To start:

export LS_COLORS="$LS_COLORS:ow=1;34:tw=1;34:*.tar=1;31:*.gz=1;31:*.tbz2=1;31"

In full for compressed files, you could add this:


Answered By: wjandrea
Categories: Answers Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.