Skip to content

Instantly share code, notes, and snippets.

@jmoz
Created January 18, 2010 13:18
Show Gist options
  • Save jmoz/280005 to your computer and use it in GitHub Desktop.
Save jmoz/280005 to your computer and use it in GitHub Desktop.
ls_colors file to change colour of ls
# di=5;34;43 Setting the LS_COLORS di parameter to the above example will make directories appear in flashing blue text with an orange background
#0 = Default Colour
#1 = Bold
#4 = Underlined
#5 = Flashing Text
#7 = Reverse Field
#31 = Red
#32 = Green
#33 = Orange
#34 = Blue
#35 = Purple
#36 = Cyan
#37 = Grey
#40 = Black Background
#41 = Red Background
#42 = Green Background
#43 = Orange Background
#44 = Blue Background
#45 = Purple Background
#46 = Cyan Background
#47 = Grey Background
#90 = Dark Grey
#91 = Light Red
#92 = Light Green
#93 = Yellow
#94 = Light Blue
#95 = Light Purple
#96 = Turquoise
#100 = Dark Grey Background
#101 = Light Red Background
#102 = Light Green Background
#103 = Yellow Background
#104 = Light Blue Background
#105 = Light Purple Background
#106 = Turquoise Background
# http://www.bigsoft.co.uk/blog/index.php/2008/04/11/configuring-ls_colors
#no NORMAL, NORM Global default, although everything should be something
#fi FILE Normal file
#di DIR Directory
#ln SYMLINK, LINK, LNK Symbolic link. If you set this to .target. instead of a numerical value, the color is as for the file pointed to.
#pi FIFO, PIPE Named pipe
#do DOOR Door
#bd BLOCK, BLK Black device
#cd CHAR, CHR Character device
#or ORPHAN Symbolic link pointing to a non-existent file
#so SOCK Socket
#su SETUID File that is setuid (u+s)
#sg SETGID File that is setgid (g+s)
#tw STICKY_OTHER_WRITABLE Directory that is sticky and other-writable (+t,o+w)
#ow OTHER_WRITABLE Directory that is other-writable (o+w) and not sticky
#st STICKY Directory with the sticky bit set (+t) and not other-writable
#ex EXEC Executable file (i.e. has .x. set in permissions)
#mi MISSING Non-existent file pointed to by a symbolic link (visible when you type ls -l)
#lc LEFTCODE, LEFT Opening terminal code
#rc RIGHTCODE, RIGHT Closing terminal code
#ec ENDCODE, END Non-filename text
#*.extension Every file using this extension e.g. *.jpg
LS_COLORS='*.html=95:*.php=1;32:di=1;94:no=00:fi=00:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=1;4;94:st=37;44:ex=0;4:*.tar=01;31:*.tgz=01;31:*.zip=01;31:*.gz=01;31:*.bz2=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.png=01;35:';
export LS_COLORS
@MiChaelinzo
Copy link

MiChaelinzo commented Oct 9, 2020

LS_COLORS=$ what command to highlight a certain dir into a certain colour? I tried LS_COLORS="di=<style>::" example: LS_COLORS="di=1;4;35;46" but it highlight all of the dirs not a certain dir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment