🃏 Expansion
警告
Work in progress!
Global expansion is the operation that expands a wildcard pattern into the list of pathnames matching the pattern. A glob is a short expression that lets you filter files by their name 99% of the time, there’s an asterisk involved.
ls ~/**/*.txt # <- THIS IS A GLOB
Globbing TL;DR
信息
- Global expansion requires
extended_glob,dot_glob, and related options to be enabled, this will treat the#,~,^, and more characters as part of patterns for filename generation, etc. - Bash won't match a
.at the start of the name or a slash, to use matching with.and/use thedot_globoption.
Enable the extended_glob option in Zsh:
setopt extended_glob
Enable the dot_glob option in Zsh:
setopt dot_glob