With bash, I used to executed ls *.JPG
to list all JPG files of a directory, but since macOS suggested me to move to zsh, this simple command doesn't work anymore and gives me the following error:
$ ls *.JPG
ls: illegal option --
usage: ls [-@ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1%] [file ...]
What the appropriate equivalent with zsh ?
ls *.JPG
) should work in zsh. Remember it's case sensitive, so you may needls *.jpg
. If you want to change back to bash, here are the instructions: https://www.howtogeek.com/444596/how-to-change-the-default-shell-to-bash-in-macos-catalina/ – moo Apr 11 '20 at 21:46JPG
, butls *.JPG
returnsls: illegal option --
andusage: ls [-@ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1%] [file ...]
. – DevonDahon Apr 11 '20 at 21:50zsh
a try before decided to change back or not tobash
. I just updated my question. – DevonDahon Apr 11 '20 at 21:58ls -- *.JPG
– Jeff Schaller Apr 11 '20 at 22:07ls -d -- *.JPG
, orprint -rC1 -- *.JPG
(zsh) as there's no point callingls
if it's just to print the arguments. – Stéphane Chazelas Apr 12 '20 at 07:46