From the course: Learning Zsh

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Expansions

Expansions - Unix Tutorial

From the course: Learning Zsh

Start my 1-month free trial

Expansions

- [Instructor] When we're working with a shell, we don't always need or want to type things explicitly. And in some cases, it's not even possible to type out information we need to use, like the output of programs or evaluations. Expansions are a whole set of behaviors that use a pattern to stand in or represent something else in a command. This is a list of the order in which various expansions occur and we'll take a look briefly at most of them. Many of the expansions have dozens of options and behaviors that I can't cover in detail here. So if you want to dig into those, take a look at the expansion section of the Z shell man page. You can get to that by typing man zshexpn. History expansion is related to the usage of the command history, as we saw earlier. History expansion comes into play when we use exclamation mark as a shorthand to replace previous commands. We can use exclamation mark and the number to…

Contents