Book Image

Learning Shell Scripting with Zsh

By : Gaston Festari
Book Image

Learning Shell Scripting with Zsh

By: Gaston Festari

Overview of this book

Table of Contents (13 chapters)

Working with history


Like an elephant, many modern Unix shells tend to remember in great detail the copious amount of commands entered while working with them. As many others, zsh too boasts a history log and an even more convenient way of accessing each of its entries. Being able to glimpse at what you have been up to is not only practical from a work-log perspective, but also as a way to speed things up. Think about it; you could use history to see (and eventually edit) a previously typed command, get a bit of context as to what's going on with your system, or avoid retyping the same thing over and over. Being able to easily retrieve a command from the past sounds awesome, because it is indeed a really neat feature.

We'll now take a look at how to use zsh's history expansion to work with previous entries in the command line.

Note

Working with history

A more traditional approach to recalling history entries is by using the up arrow and down arrow keys on your keyboard to scroll through history...