Loop through files in Mac terminal
Try this, please:
for f in $(ls /Users/nick/Desktop/*.jpg);
do echo $f;
done
for f in /Users/nick/Desktop/*.jpg; do echo $f; done
Edit Actually I think that this comment of @KyleBurton is very clever and should be taken into an account, since it explains why a result like that could be observed.