20151030 displaying terminal color mappings - plembo/onemoretech GitHub Wiki

title: Displaying terminal color mappings link: https://onemoretech.wordpress.com/2015/10/30/displaying-terminal-color-mappings/ author: phil2nc description: post_id: 10210 created: 2015/10/30 08:49:22 created_gmt: 2015/10/30 12:49:22 comment_status: closed post_name: displaying-terminal-color-mappings status: publish post_type: post

Displaying terminal color mappings

Here's a small script that displays most of the color mappings stored in the bash shell's $LS_COLORS variable for most Linux distributions: [code language="bash" gutter="false"] eval $(echo "no:global default;fi:normal file;di:directory;ln:symbolic link;pi:named pipe;so:socket;do:door;bd:block device;cd:character device;or:orphan symlink;mi:missing file;su:set uid;sg:set gid;tw:sticky other writable;ow:other writable;st:sticky;ex:executable;"|sed -e 's/:/="/g; s/;/"\n/g') { IFS=: for i in $LS_COLORS do echo -e "\e[${i#=}m$( x=${i%=}; [ "${!x}" ] && echo "${!x}" || echo "$x" )\e[m" done } [/code]

Copyright 2004-2019 Phil Lembo