aboutsummaryrefslogtreecommitdiff
path: root/sh/shrc.d/la.sh
diff options
context:
space:
mode:
Diffstat (limited to 'sh/shrc.d/la.sh')
-rw-r--r--sh/shrc.d/la.sh10
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 "$@"
+}