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 | |
parent | Adjust ordering of ls() and grep() options (diff) | |
download | dotfiles-bf86a2f939651b691a2ee814de7853424455c813.tar.gz dotfiles-bf86a2f939651b691a2ee814de7853424455c813.zip |
Add la(), ll()
Diffstat (limited to 'sh')
-rw-r--r-- | sh/profile.d/ls.sh | 3 | ||||
-rw-r--r-- | sh/shrc.d/la.sh | 10 | ||||
-rw-r--r-- | sh/shrc.d/ll.sh | 10 |
3 files changed, 22 insertions, 1 deletions
diff --git a/sh/profile.d/ls.sh b/sh/profile.d/ls.sh index 8a255bee..2b0f507d 100644 --- a/sh/profile.d/ls.sh +++ b/sh/profile.d/ls.sh @@ -13,7 +13,8 @@ # Iterate through some useful options and create files to show they're # available - set -- block-size \ + set -- almost-all \ + block-size \ classify \ color \ human-readable \ 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 "$@" +} diff --git a/sh/shrc.d/ll.sh b/sh/shrc.d/ll.sh new file mode 100644 index 00000000..c8c95d3b --- /dev/null +++ b/sh/shrc.d/ll.sh @@ -0,0 +1,10 @@ +# Run ls -Al if we can (-A is not POSIX), ls -al otherwise +ll() { + # Prefer -A/--almost-all (exclude "." and "..") if available + if [ -e "$HOME"/.cache/ls/almost-all ] ; then + set -- -Al "$@" + else + set -- -al "$@" + fi + ls "$@" +} |