Is it possible to have the colors for symlinks-to-directories be colored differently than other symlinks?

I know I can do:

Link target

to get the symlinks to take the color settings of their target, but that hides the fact that they're symlinks (unless you ls -la) and I like seeing that information.

So I'd like to make symlinks to directories bold, and symlinks to non-directories not bold, both the same color.

Is this possible?


Unfortunately it is not possible:

This is mine color setup(distribution default):

host:~# env| grep LS_COLORS

These are the options of filetype:

di = directory
fi = file
ln = symbolic link
pi = fifo file
so = socket file
bd = block (buffered) special file
cd = character (unbuffered) special file
or = symbolic link pointing to a non-existent file (orphan)
mi = non-existent file pointed to by a symbolic link (visible when you type ls -l)
ex = file which is executable (ie. has 'x' set in permissions).

And, you can use filename regex to create different colors like *.rpm to rpm files.

However, there is no specific "dir symlink" to be used with ls color. Sorry.

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.