Skip to content

Commit 018a6df

Browse files
committed
fix(alias): ls alias lx is an illegal option on MacOS/BSD
The option `-X` lets MacOS (and probably also other BSD-ish OS) ls complain about an illegal option: ``` ls -lhXB ls: illegal option -- X usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...] ```
1 parent f4ca9eb commit 018a6df

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

modules/utility/init.zsh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ alias ll='ls -lh' # Lists human readable sizes.
118118
alias lr='ll -R' # Lists human readable sizes, recursively.
119119
alias la='ll -A' # Lists human readable sizes, hidden files.
120120
alias lm='la | "$PAGER"' # Lists human readable sizes, hidden files through pager.
121-
alias lx='ll -XB' # Lists sorted by extension (GNU only).
121+
if [[ "$OSTYPE" != darwin* ]]; then
122+
alias lx='ll -XB' # Lists sorted by extension (GNU only).
123+
fi
122124
alias lk='ll -Sr' # Lists sorted by size, largest last.
123125
alias lt='ll -tr' # Lists sorted by date, most recent last.
124126
alias lc='lt -c' # Lists sorted by date, most recent last, shows change time.

0 commit comments

Comments
 (0)