EshellGlobbing

Globbing in eshell

With zsh or eshell you can use **/*.[ch] to expand into a list of all files matching *.[ch].

And so much more.

Normal globbing

*.c
All files ending in .c
?.c
Any single character followed by .c
[a-f]*.c
Any file beginning a-f followed by .c

Extended globbing

a#.c
A C file named by zero or more ‘a’ characters
a##.c
A C file named by one or more a characters

Recursive globbing

*/*.c
All C files in all subdirectories
*/CVS/Root
All CVS/Root files

Predicated globbing

e*(*)
All executable files beginning with e
*/*(@)
All symbolic links (searched recursively)
*/*(a+30)
All files not accessed in the last 30 days

Filtered globbing

*.c(:U)
All C filenames in uppercase

All of these features are supported by both zsh[1] and Eshell. In fact, Eshell was implemented in terms of the zsh 4.0 InfoMode manual, so I recommend reading there. – JohnWiegley


Lisp ties

Further, Eshell allows for Lisp ties in to the predication and filtering rules:

*.c('file-writable-p)
Lispy way of doing *.c(w)
*.c(|upcase)
Lispy way of doing *.c(:U)

See also:


CategoryEshell