1

So, here's the peculiar situation:

$ ls -l foo.sqlite foo.ssqlite
-rw-r--r-- 1 xie xie 8192 Jan 22 19:25 foo.sqlite
-rw-r--r-- 1 xie xie 8192 Jan 23 11:48 foo.ssqlite

In the output, foo.sqlite is colored blue by ls while foo.ssqlite is colored red/pink. Permissions are the same, types are the same:

$ file foo.sqlite foo.ssqlite
foo.sqlite:  SQLite 3.x database, last written using SQLite version 3026000
foo.ssqlite: SQLite 3.x database, last written using SQLite version 3023001

The only obvious difference is that foo.sqlite was created by a Perl script, while the other - by a Python script, however that does not explain the different coloring, as if ls recognizes these as two different file types. Well, the question then is why does ls report these in different colors despite the type being the same?

2

Apparently, ls relies on environment variable $LS_COLORS. Doing echo "$LS_COLORS" | grep --color sqlite revealed an entry with value *.sqlite=38;5;147, which apparently is the 256-color ANSI escape color code in form ESC[38;5;#m for foreground color.

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.