A Quick Introduction to Z shell

Shell applications like bash, zsh allows us to execute commands, run scripts, and perform various tasks such as managing files and directories, starting and stopping programs, and more.

Z shell (Zsh) is a popular Unix shell that is similar to the Bourne shell (sh), plus it includes many additional features. It was originally developed by Paul Falstad in 1990. In 2019, macOS Catalina switched from Bash to Zsh making it the default shell.

Zsh has many features that make it well-suited for interactive use. Let’s take a look at some.

Up Arrow to Search by Prefix

We know that we can use the up arrow ↑ to search through history. However, in Zsh, we can use up arrow to search by prefix.

Suppose you’ve entered these commands:

$ ls
$ ls -al
$ ls -l

If you want to recall ls -al, you can type ls -a and then press the up arrow key to search for the matching command in your history. This will display ls -al. This is very convenient and allows you to search your history more efficiently.

take



Speak Your Mind

-->