#!/bin/bash # must be sourced # see `man dircolors` # in particular `dircolors -p > coldb.txt` (-p, --print-database) # attributes # 00 = none # 01 = bold (bright) # 04 = underscore (white; disables color code) # 05 = blink (gray background) # 07 = reverse (color as background) # 08 = concealed (doesn't do anything) # colors R='00;31' # red G='00;32' # green Y='00;33' # yellow (brown in my console) B='00;34' # blue M='00;35' # magenta C='00;36' # cyan W='00;37' # white # bold (bright) BR='01;31' # red BG='01;32' # green BY='01;33' # yellow BB='01;34' # blue BM='01;35' # magenta BC='01;36' # cyan BW='01;37' # white # for di (below) and possible some others BL='00;30' # black GR='01;30' # gray # background BGBL='40' # blue BGRE='41' # red BGGR='42' # green BGYE='43' # yellow BGBL='44' # blue BGMA='45' # magenta BGCY='46' # cyan BGWH='47' # white RS="rs=0" # reset DI="di=$BB" # directory LN="ln=$C" # link MH="mh=00" # multihardlink (file with more than one link) PI="pi=$BY;$BGBL" # pipe (FIFO) SO="so=$BM" # socket DO="do=$BM" # door BD="bd=$BY;$GBBL" # block device driver CD="cd=$BY;$BGBL" # character device driver OR="or=$BR" # symlink to nonexistent (or non-stat'able) file SU="su=$W;$BGRE" # file that is setuid (u+s) SG="sg=$BL;$BGYE" # file that is setgid (g+s) CA="ca=$BL;$BGRE" # file with capability TW="tw=$BL;$BGGR" # dir that is sticky and other-writable (+t,o+w) OW="ow=$BB;$BGGR" # dir that is other-writable (o+w) and not sticky ST="st=$BW;$BGBL" # sticky bit dir (+t) and not other-writable EX="ex=$BG" # file with execute permission ARCHIVE="*.tar=$BR:*.tgz=$BR:*.arj=$BR:*.taz=$BR:*.lzh=$BR:*.lzma=$BR:*.tlz=$BR:*.txz=$BR:*.zip=$BR:*.z=$BR:*.Z=$BR:*.dz=$BR:*.gz=$BR:*.lz=$BR:*.xz=$BR:*.bz2=$BR:*.bz=$BR:*.tbz=$BR:*.tbz2=$BR:*.tz=$BR:*.deb=$BR:*.rpm=$BR:*.jar=$BR:*.war=$BR:*.ear=$BR:*.sar=$BR:*.rar=$BR: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