-
-
Save TripleDogDare/e24fa5dff013ed695230e7e282cece89 to your computer and use it in GitHub Desktop.
ls/less alias
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
#!/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