aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sh/shrc.d/ls.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/sh/shrc.d/ls.sh b/sh/shrc.d/ls.sh
index 58263e96..c7703663 100644
--- a/sh/shrc.d/ls.sh
+++ b/sh/shrc.d/ls.sh
@@ -31,6 +31,12 @@ ls() {
[ -e "$HOME"/.cache/ls/time-style ] &&
set -- --time-style='+%Y-%m-%d %H:%M:%S' "$@"
+ # Add -G for colorized output if the operating system is FreeBSD
+ # We have to check because -G means something else to e.g. GNU ls(1)
+ case $OS in
+ FreeBSD) set -- -G "$@" ;;
+ esac
+
# Run ls(1) with the concluded arguments
command ls "$@"
}