From 0aa4cf91e1c07a2271b03a3bccb2f1748f552e93 Mon Sep 17 00:00:00 2001 From: Ben O'Hara Date: Sun, 17 Jun 2012 14:40:29 +1000 Subject: [PATCH] group-directories-first was introduced in coreutils 6 --- modules/utility/init.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index 53b618d4..2e58c8e0 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -56,7 +56,9 @@ alias type='type -a' # ls if is-callable 'dircolors'; then # GNU Core Utilities - alias ls='ls --group-directories-first' + if [[ `dircolors --version |head -1 |awk '{print $NF}'` > 6 ]]; then + alias ls='ls --group-directories-first' + fi if zstyle -t ':omz:module:utility:ls' color; then if [[ -s "$HOME/.dir_colors" ]]; then