소스 검색

Add coloured output for ls

Weiyi Lou 10 년 전
부모
커밋
7e1cc806e6
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  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'