Created
April 10, 2015 08:33
-
-
Save mopp/6791193a05af77feec9d 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
# Filtered ls | |
function fls() { | |
if [ $# -eq 0 ]; then | |
ls | |
exit 0 | |
fi | |
ls_arg="" | |
grep_arg="" | |
case $1 in | |
*-*) | |
ls_arg=$1 | |
;; | |
*) | |
grep_arg=$1 | |
;; | |
esac | |
if [ $# -eq 2 ]; then | |
case $2 in | |
*-*) | |
ls_arg=$2 | |
;; | |
*) | |
grep_arg=$2 | |
;; | |
esac | |
fi | |
ls $ls_arg | grep --color=no $grep_arg | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment