LS – What Does a Red-Colored Filename Mean?

colorsls

I have been exploring files in bash, and in /etc/ssl/certs, most of the filenames are light blue. There is a red filename though, and I can't figure out why it is red.

Most of the files in this directory are .pem files. The red one is also a .pem file. It happens to be something like China_Internet_Network_Information_Center...pem

According to this stack exchange question , light blue filenames mean linked files, while red file names mean "archived" files. What does that mean? Looking at the directory with ls -all, I still can't tell what makes the filename red. Can anyone explain why it is red?

Best Answer

First you need to know the VT100 color code

https://en.wikipedia.org/wiki/ANSI_escape_code#Colors

I don't know what your text actually looks like, but "red text" is 31.

Then you want to look at the dircolors command, and find everything that has a 31 in it. In my case, that would be:

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

Then you can go here

http://www.bigsoft.co.uk/blog/index.php/2008/04/11/configuring-ls_colors

which tells you

  • or is an "orphan", a symbolic link with no target
  • the rest are file globs that match assorted archive and compression schemes

.pem doesn't appear on my list, and .pem files aren't colored on my system, so I can't help you further than that. But I'd guess "orphan".

Related Question