diff --git a/.bash_aliases b/.bash_aliases index 0463208..9b7e9a4 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -17,6 +17,19 @@ l () { local target="${1:-$(pwd)}" if [ -f $target ] ; then + # Target is not a text file + if [ -L $target ] || grep -q -P "[^\x00-\x7F]" $target; then + ls -lah $target + + # Target is not a symlink, so it must be binary + if [ ! -L $target ]; then + echo "" + echo -e "\033[96mBinary file. Run 'll $target' to preview anyways.\e[0m" + fi + + return + fi + less $target return fi