Skip to content

Instantly share code, notes, and snippets.

@TripleDogDare
Last active July 29, 2016 20:13
Show Gist options
  • Save TripleDogDare/e24fa5dff013ed695230e7e282cece89 to your computer and use it in GitHub Desktop.
Save TripleDogDare/e24fa5dff013ed695230e7e282cece89 to your computer and use it in GitHub Desktop.
ls/less alias
#!/bin/bash
set -euo pipefail
TARGET=${1:-.}
if [ -d "$TARGET" ]; then
ls -al --color=yes "$TARGET"
elif [ -f "$TARGET" ]; then
less "$TARGET"
else
>&2 echo "$TARGET is not a directory or file"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment