1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 07:08:01 +00:00

Add Globbing For All Directories In Zsh as a unix til

This commit is contained in:
jbranchaud
2016-06-08 08:17:38 -05:00
parent ffa8e35085
commit 4b4e690ea9
2 changed files with 22 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
# Globbing For All Directories In Zsh
Globbing in Zsh is an expressive way to generate filenames for commands.
This includes working with directories. If I'd like to run a command against
all directories in the current directory, I can employ the `*(/)` globbing
pattern.
```bash
$ echo *(/)
one three two
```
What about all directories in the root directory?
```bash
$ echo /*(/)
/Applications /Library /Network /System /Users /Volumes /bin /cores /dev /home /net /opt /private /sbin /usr
```
[source](http://zsh.sourceforge.net/Intro/intro_2.html)