Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

Bash Scripting – Difference between Zsh and Bash

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

A shell is an environment in which various commands can be executed, it provides an interface between the user and the UNIX system. Basically, a shell is a command-line interpreter which is interprets the commands given by the user, it can also read the combination of such commands which is known as a shell script. The shell provides us with an environment in which we can execute our commands, scripts, and programs.

Here in this article, we are going to differentiate between the two most popular shells bash and zsh.

Bash ( Bourne-Again shell )

Bash, or the Bourne-Again Shell, is by far the most popularly used shell and it comes installed as the default shell in the most popular Linux distributions. Bash is the default login shell for most Linux distributions. It is also accessible for Windows and it is the default user shell in Ubuntu, Linux Mint, Solaris 11, Pop OS, etc.

A bash session

 

Zsh ( Z shell )

Zsh is also an environment that can be used as a command-line interpreter for shell scripting or as an interactive login shell. Zsh is built on top of bash thus it has additional features. Zsh is the default shell for macOS and Kali Linux. Zsh provides the user with more flexibility by providing various features such as plug-in support, better customization, theme support, spelling correction, etc.

A Zsh session

 

Table of Difference between Bash and Zsh

Bash

Zsh                    

Bash is the default shell for Linux and it is released in the replacement of Bourne Shell.

Z shell is built on top of the bash shell and is an extended version of the bash with plenty of new features.

Bash reads the .bashrc file in non-login interactive shell and .bash_profile in login shells. Zsh reads .zshrc in an interactive shell and .zprofile in a login shell.
Bash uses backslash escapes. Zsh uses percentage escapes.
Bash doesn’t have an inline wildcard expansion. Zsh has a built-in wildcard expansion.
Doesn’t have customization options. Zsh has many frameworks that provide customization.
It doesn’t have many themes and plug-in support. Has plenty of plug-in’s and themes.
Bash lacks syntax highlighting and auto-correction features. Zsh has syntax highlighting and auto-correction features.
In bash keybinding is done using ‘.inputrc’ and ‘bind builtin’. In zsh binding is done using ‘bindkey builtin’.
My Personal Notes arrow_drop_up
Last Updated : 02 Jun, 2022
Like Article
Save Article
Similar Reads
Related Tutorials