0

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

4
  • Try running ls --color=auto
    – wjandrea
    Nov 26, 2020 at 23:26
  • ls --color=auto didn't make any change still all in white
    – alper
    Nov 27, 2020 at 3:16
  • What's the full value of $LS_COLORS?
    – wjandrea
    Nov 27, 2020 at 3:20
  • its: :ow=1;34:tw=1;34::ow=1;34:tw=1;34:
    – alper
    Nov 27, 2020 at 3:22

1 Answer 1

1

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

:ow=1;34:tw=1;34::ow=1;34:tw=1;34:

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:

*.tar=1;31:*.tgz=1;31:*.arj=1;31:*.taz=1;31:*.lzh=1;31:*.lzma=1;31:*.tlz=1;31:*.txz=1;31:*.zip=1;31:*.z=1;31:*.Z=1;31:*.dz=1;31:*.gz=1;31:*.lz=1;31:*.xz=1;31:*.bz2=1;31:*.bz=1;31:*.tbz=1;31:*.tbz2=1;31:*.tz=1;31:*.deb=1;31:*.rpm=1;31:*.jar=1;31:*.war=1;31:*.ear=1;31:*.sar=1;31:*.rar=1;31:*.ace=1;31:*.zoo=1;31:*.cpio=1;31:*.7z=1;31:*.rz=1;31

2
  • For full compressed files should I do as follows: export LS_COLORS="$LS_COLORS:<your_answer>" ?
    – alper
    Nov 27, 2020 at 3:30
  • 1
    @alper Yes, exactly. I tried putting that in the answer but it was hard to read. :p
    – wjandrea
    Nov 27, 2020 at 3:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .