[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Terminal Color-Coding



On Sun, Jul 01, 2018 at 02:38:42PM +1000, terryc wrote:
> On Sat, 30 Jun 2018 19:44:42 -0500
> "Josh W." <joshw8104@gmail.com> wrote:
> 
> > Hi, I was working in my Terminal cleaning up my files and folders
> > when i needed a second terminal. When i opened it up the Color-Coding
> > that was visible in my current terminal, was plain grey and black. I
> > restart my computer hoping that it would be a quick fix, but no luck.
> > So i tried tuning the setting, and that was a bust as well. I restart
> > my Computer and it remains the same, the color coding is gone. I
> > remember a while back there was a way to set the color coding, say i
> > was running as root and wanted to have the Coding running so i could
> > tell directories form executable and such. Could anybody help w/
> > this?? It would be greatly appreciated!
> 
> My 2c guess is that you want something like /usr/bin/dircolors which
> sets the various colours used when you invoke ls.
> 
> FWIW, I have various xterm scripts in /usr/local/bin for when I want to
> set the basic colours for my xterms. e.g
> 
> #! /bin/sh
> exec   xterm -fg black -bg LightGrey -fa mono -fs 16  &
> 
> xt-16-lg (END)


With much bash goodness, the need to split ye olde rc file into
subfiles became evident, so here is a dump of my "aliii-ls.rc"
sub file:

# for alphabetical sorting, ignoring case (like windows):
Z_COLLATE_u="LC_COLLATE=$LANG"
# for traditional unix sorting, lowercase last:
Z_COLLATE_C="LC_COLLATE=C"
#Z_LS_OPTS0="--time-style=long-iso -bh"
Z_LS_OPTS0="--time-style="+%Y%m%d\\\ %H:%M.%S" -bh"

# here's the ls option you might be needing/ missing (--color):
Z_LS_OPTS1="$Z_LS_OPTS0 --color"

alias  lsl="$Z_COLLATE_u ls $Z_LS_OPTS0 -l"
alias  lll="$Z_COLLATE_u ls $Z_LS_OPTS1 -lL"

alias    l="$Z_COLLATE_u ls $Z_LS_OPTS1 -B"
alias   ll="$Z_COLLATE_u ls $Z_LS_OPTS1 -Bo"
alias  lld="$Z_COLLATE_u ls $Z_LS_OPTS1 -Bod"

alias   la="$Z_COLLATE_u ls $Z_LS_OPTS1 -A"
alias  lal="$Z_COLLATE_u ls $Z_LS_OPTS1 -Al"
alias lald="$Z_COLLATE_u ls $Z_LS_OPTS1 -Ald"

#alias  dir='LANG=C ls --color=auto --format=vertical'
#alias vdir='LANG=C ls --color=auto --format=long'

# change dark blue (hard-to-see) dirs to yellow:
export LS_COLORS="ow=01;93:di=01;33"


Good luck :)


Reply to: