Browse Source

Add coloured output for ls

Weiyi Lou 9 years ago
parent
commit
7e1cc806e6
1 changed files with 8 additions and 0 deletions
  1. 8 0
      shell/common/directories.sh

+ 8 - 0
shell/common/directories.sh

@@ -1,3 +1,11 @@
+# Coloured output for ls
+if [[ -n $(command -v dircolors) ]]; then
+  eval "`dircolors -b`"
+  alias ls='ls --color=auto'
+elif [[ $(uname -s) = Darwin ]]; then
+  alias ls='ls -G'
+fi
+
 # Folder listing/traversal
 # Folder listing/traversal
 alias l='ls'
 alias l='ls'
 alias la='ls -A'
 alias la='ls -A'