Zsh: sort globs in natural order with the (n) glob qualifier

· Adamj · Sept. 30, 2026, 7:54 p.m.
Summary
This blog post discusses how to sort filenames in natural order using the (n) glob qualifier in Zsh. It explains the common issue with globs sorting character by character, causing unexpected ordering of numbered files, and presents the (n) qualifier as a solution to handle digits correctly. The author shares insights that can help other developers avoid confusion when working with file names in the terminal.
AUTHOR