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.

Command history

Command history - Unix Tutorial

From the course: Learning Zsh

Start my 1-month free trial

Command history

- [Instructor] As we're typing and using commands, we often need to run the same command or a slightly modified version of that command more than once over time. In order to help out with this and to prevent us from having to type commands all over again, Z shell offers a useful command history feature. The most basic way of using this is to press the up arrow at the command line. (keyboard typing) Pressing up once recalls the previous command, which we can then edit or press Enter or Return to run. Pressing the up arrow more than once cycles backward through the command history, and pressing down moves back down the list. If you have a multi-line command in your history, like the definition of a function, you can edit as well before running it. If you've configured your shell to use a history file, the history of your commands will be stored there. Usually it's in the Home directory, in a file called .histfile.…

Contents