Created
September 22, 2012 19:20
-
-
Save marr/3767498 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------------------------------------------------------------- | |
# LS AND DIRCOLORS | |
# ---------------------------------------------------------------------- | |
# we always pass these to ls(1) | |
LS_COMMON="-hBG" | |
# if the dircolors utility is available, set that up to | |
dircolors="$(type -P gdircolors dircolors | head -1)" | |
test -n "$dircolors" && { | |
COLORS=/etc/DIR_COLORS | |
test -e "/etc/DIR_COLORS.$TERM" && COLORS="/etc/DIR_COLORS.$TERM" | |
test -e "$HOME/.dircolors" && COLORS="$HOME/.dircolors" | |
test ! -e "$COLORS" && COLORS= | |
eval `$dircolors --sh $COLORS` | |
} | |
unset dircolors | |
# setup the main ls alias if we've established common args | |
test -n "$LS_COMMON" && | |
alias ls="command ls $LS_COMMON" | |
# these use the ls aliases above | |
alias ll="ls -l" | |
alias l.="ls -d .*" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment