diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-21 14:48:13 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-21 14:48:13 +1200 |
commit | bf86a2f939651b691a2ee814de7853424455c813 (patch) | |
tree | 29febe40833f4c1af6741c77bec01e5ce920233e /sh/shrc.d/la.sh | |
parent | Adjust ordering of ls() and grep() options (diff) | |
download | dotfiles-bf86a2f939651b691a2ee814de7853424455c813.tar.gz dotfiles-bf86a2f939651b691a2ee814de7853424455c813.zip |
Add la(), ll()
Diffstat (limited to 'sh/shrc.d/la.sh')
-rw-r--r-- | sh/shrc.d/la.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sh/shrc.d/la.sh b/sh/shrc.d/la.sh new file mode 100644 index 00000000..e21ad8fb --- /dev/null +++ b/sh/shrc.d/la.sh @@ -0,0 +1,10 @@ +# Run ls -A if we can (-A is not POSIX), ls -a otherwise +la() { + # Prefer --almost-all (exclude "." and "..") if available + if [ -e "$HOME"/.cache/ls/almost-all ] ; then + set -- -A "$@" + else + set -- -a "$@" + fi + ls "$@" +} |