From b97ddabfe209142136ab5c111ec6f901812d5425 Mon Sep 17 00:00:00 2001 From: Josh Sherick Date: Wed, 1 Jun 2016 12:02:32 -0600 Subject: [PATCH] Displays colors in GNU and BSD ls --- bashrc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bashrc b/bashrc index c78f231..c3d2e71 100644 --- a/bashrc +++ b/bashrc @@ -12,6 +12,11 @@ export PROMPT_COMMAND='if [ "$(id -u)" -ne 0 ]; then echo "$(date "+%Y-%m-%d.%H: eval "$(hub alias -s)" -alias ls="ls -G" +# Have LS always display colors +if ls --color -d ~ >/dev/null 2>&1; then + alias ls="ls --color=auto" # GNU ls +elif ls -G -d ~ >/dev/null 2>&1; then + alias ls="ls -G" # BSD ls +fi alias tm="tmux at || command tmux" alias cdgit='cd $(git rev-parse --show-toplevel)'