From 534b08887f42a83a3a0ececde54db535cbf3fbf1 Mon Sep 17 00:00:00 2001 From: Stanislav N Date: Mon, 16 Jan 2017 12:38:13 +0500 Subject: [PATCH] Fix for macOS's ls vs gls thing. It will use GNU coreutils version if available. --- zsh/aliases/30-macos.conf | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/zsh/aliases/30-macos.conf b/zsh/aliases/30-macos.conf index 1e0183f..3d22804 100644 --- a/zsh/aliases/30-macos.conf +++ b/zsh/aliases/30-macos.conf @@ -1,6 +1,11 @@ # Some good aliases for macOS. -if [ "${OS/DarwinD}" != "${OS}" ]; then +if [ "${OS/Darwin}" != "${OS}" ]; then # Files navigation. - alias ls="ls -G" + # ls - use GNU coreutils version if available. + if [ -f "/usr/local/bin/gls" ]; then + alias ls="/usr/local/bin/gls --color" + else + alias ls="/bin/ls -G" + fi fi \ No newline at end of file