diff --git a/.bash_aliases b/.bash_aliases index e324dd5..f457fd2 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -5,32 +5,32 @@ mkcdir () { # Preview contents of a file or list the contents of a directory l () { - if [ -n "$1" ] ; then + if [ -f "$1" ] ; then less $1 return fi - ls -lh $1 + ls -lh $1 || l $(dirname "$1") } # Preview the contents of a file or list the contents of a directory with hidden files shown ll () { - if [ -n "$1" ] ; then + if [ -f "$1" ] ; then less $1 return fi - ls -lah $1 + ls -lah $1 || ll $(dirname "$1") } # Edit the contents of a file or list the contents of a directory (with hidden files shown) if that file is not found lll () { - if [ -n "$1" ] ; then + if [ -f "$1" ] ; then nano $1 return fi - ls -lah $1 + ls -lah $1 || lll $(dirname "$1") } .. () {