ZSH Glob Exclusion - Today I Learned
til.hashrocket.com › posts › 55af63afcf-zsh-globZSH Glob Exclusion. I want to list everything except a .jpg file from the files . foo.doc foo.gif foo.jpg. but if I use print -l * I get them all back. To exclude a pattern in zsh you first must turn on extendedglob. $ setopt extendedglob. Then, everything after the ^ will be treated as an exclusion. $ print -l ^*jpg foo.doc foo.gif Tweet
Globbing with zsh | Linuxaria
https://linuxaria.com/howto/globbing-con-zsh23.10.2010 · Glob qualifiers are another nice addition to Zsh: it has the ability to select types of files by using some flags in parentheses at the end of the globbing pattern. You can use (.) for regular files only, (/) for directories, (*) for executable files, (@) for symlinks, (=) for sockets, (p) for named pipes, (%) for device files, (%b) for block files and (%c) for character files.