From 4391155915233a2117146bec29931602165ad5ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=9F=E9=85=8C=20=E9=B5=AC=E5=85=84?= Date: Tue, 25 Nov 2014 10:48:52 +0800 Subject: [PATCH] Alias for ls --- bash/bashrc/sources/10_aliases | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/bash/bashrc/sources/10_aliases b/bash/bashrc/sources/10_aliases index 34ef619..914b5b2 100755 --- a/bash/bashrc/sources/10_aliases +++ b/bash/bashrc/sources/10_aliases @@ -1,5 +1,22 @@ #!/bin/bash +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + alias dir='dir --color=auto' + alias vdir='vdir --color=auto' + + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + +# some more ls aliases +alias ll='ls -l' +alias la='ls -A' +alias l='ls -CF' + # directory navigations alias p=pushd alias pp='pushd +2'