{"id":1040,"date":"2023-06-06T07:40:32","date_gmt":"2023-06-06T07:40:32","guid":{"rendered":"https:\/\/www.dedicatedcore.com\/blog\/?p=1040"},"modified":"2025-03-18T12:00:29","modified_gmt":"2025-03-18T12:00:29","slug":"install-zsh-ubuntu","status":"publish","type":"post","link":"https:\/\/www.dedicatedcore.com\/blog\/install-zsh-ubuntu\/","title":{"rendered":"How to Install and Setup Zsh in Ubuntu 22.04"},"content":{"rendered":"<p>The abbreviation Zsh stands for Z Shell, a robust and customizable command-line shell. That provides several features and enhancements over Bash by default. Zsh can be an excellent option if you&#8217;re an Ubuntu user. If you are trying to improve your command-line experience. This article will lead you through the process of installing Zsh on an Ubuntu system. Enabling you to fully utilize its capabilities and boost your command-line productivity.<\/p>\n<p>An interactive Unix shell called the Z Shell (Zsh) can be used as a command interpreter for shell scripting. It is an improved version of the Bourne shell that includes some Bash, ksh, and tcsh functionality. Learn how to effortlessly manage your Ubuntu server with our thorough manual on installing Webmin, <a href=\"https:\/\/www.dedicatedcore.com\/blog\/install-webmin-ubuntu\/\" target=\"_blank\" rel=\"noopener\">making administrative tasks simpler<\/a> and more efficient.<\/p>\n<p>Command-line completion, shared histories, enhanced globbing, intelligent tab completion, and spelling correction. A wide range of plugins and themes are just a few advantages that Zsh has to offer. In this article, you will discover what is zsh and how to set up and install the Z Shell on Ubuntu. Apart from this If you&#8217;re looking for an efficient yet affordable solution, UK\u2019s Cheap KVM Linux VPS <a href=\"https:\/\/www.dedicatedcore.com\/vps-hosting-uk\/\" target=\"_blank\" rel=\"noopener\">offers seamless performance<\/a> and control. A KVM-based VPS ensures dedicated resources and full virtualization for better stability.<\/p>\n<p><strong>Requirements<\/strong><\/p>\n<ul>\n<li>An Ubuntu-running computer.<\/li>\n<li>A user account with root rights.<\/li>\n<li>Use the terminal by pressing Ctrl + Alt + T.<\/li>\n<\/ul>\n<h2>Install Zsh on Ubuntu 20.04 | 22.04<\/h2>\n<p>Bash is the default shell for Ubuntu. To install and utilize Z Shell on Ubuntu, follow these steps:<\/p>\n<h3>Step 1: Update the System Repository First.<\/h3>\n<p>To receive the most recent software version available, update the system package repository. Run the following command after opening the terminal:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo apt update<\/pre>\n<p>When prompted, enter the administrator password and hit Enter. Hold off till the procedure is over.<\/p>\n<p>By updating the package repository, you can make sure that your system has the most recent knowledge of software packages and their dependencies when installing new software.<\/p>\n<h3>Step 2: Install Zsh after the System Repository is Updated<\/h3>\n<p>For Ubuntu, enter the following command to install Z Shell:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo apt install zsh -y<\/pre>\n<p>When prompted during installation, the -y flag automatically responds &#8220;yes&#8221; and gives permission to install Zsh and any dependencies it needs. If you wish to inspect the installation, leave out the flag.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1043\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/installing-zsh-ubuntu.png\" alt=\"install zsh on ubuntu\" width=\"800\" height=\"568\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/installing-zsh-ubuntu.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/installing-zsh-ubuntu-300x213.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/installing-zsh-ubuntu-150x107.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/installing-zsh-ubuntu-768x545.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/installing-zsh-ubuntu-100x71.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/installing-zsh-ubuntu-634x450.png 634w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<h3>Step 3: Verify Installation<\/h3>\n<p>Check the application version to see if the installation was successful after it is complete. Run the command line:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">zsh --version<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1044\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/zsh-version-check.png\" alt=\"command to check zsh version in ubuntu\" width=\"800\" height=\"151\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/zsh-version-check.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/zsh-version-check-300x57.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/zsh-version-check-150x28.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/zsh-version-check-768x145.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/zsh-version-check-100x19.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/zsh-version-check-700x132.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<p>The system&#8217;s most recent version is displayed in the output.<\/p>\n<h4>Ubuntu Zsh Configuration<\/h4>\n<p>You may customize the shell environment, increase efficiency with intelligent tab completion, and take advantage of the adaptability of Zsh scripting features by configuring Zsh in Ubuntu.<\/p>\n<p>In this section, you will learn how to set up Zsh as your default shell in Ubuntu and be given an overview of your customization options.<\/p>\n<h4>Introductory Configuration<\/h4>\n<p>Zsh needs initial configuration when it is started for the first time, unlike Bash and other shells. Enter the shell name into the terminal to launch Zsh:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">zsh<\/pre>\n<p>The configuration choices that Zsh presents upon initial starting are seen in the following screenshot:<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1045\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/initial-zsh-configuration.png\" alt=\"output shows configuration options that Zsh offers\" width=\"800\" height=\"512\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/initial-zsh-configuration.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/initial-zsh-configuration-300x192.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/initial-zsh-configuration-150x96.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/initial-zsh-configuration-768x492.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/initial-zsh-configuration-100x64.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/initial-zsh-configuration-700x448.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<ul>\n<li>To access the main menu and customize each setting individually, Press 1.<\/li>\n<li>Add the default settings to the configuration file (.zshrc), which you may then edit by hand by Pressing 2.<\/li>\n<li>To start from scratch and create an empty .zshrc configuration file, press 0.<\/li>\n<li>To end the setup and restart it the following time you enter Zsh, press q.<\/li>\n<\/ul>\n<p>The changes are saved when you finish the setup, and the Z Shell prompt then displays. The first configuration only appears the first time you run the shell, but with the zsh-newuser-install command, you can execute the initial setup again.<\/p>\n<h4>Default to Zsh as the Shell<\/h4>\n<p>Zsh is not setup or set as the default shell after installation. To make Zsh your default shell, take the following actions:<\/p>\n<p>1. Verify which system shell is the default one:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">echo $SHELL<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1046\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/echo-shell-checks-default-shell.png\" alt=\"output displays shell value which is default shell\" width=\"800\" height=\"131\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/echo-shell-checks-default-shell.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/echo-shell-checks-default-shell-300x49.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/echo-shell-checks-default-shell-150x25.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/echo-shell-checks-default-shell-768x126.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/echo-shell-checks-default-shell-100x16.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/echo-shell-checks-default-shell-700x115.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<p>The result displays the default shell, which is the value of the $SHELL variable.<\/p>\n<p>2. To alter the default login shell, use the chsh (change shell) command. With chsh, you can alter the default shell using the following syntax:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">chsh -s [path] [user]<\/pre>\n<ul>\n<li>The path to the shell you want to use is specified by [path].<\/li>\n<li>The user for which you want to modify the default shell is specified by [user].<\/li>\n<li>The default shell for the current user is altered if the user is not specified.<\/li>\n<\/ul>\n<p>Use the which command to specify the Zsh path automatically if you are unsure of the shell path. For instance:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">chsh -s $(which zsh)<\/pre>\n<p>When prompted, enter the root password and hit Enter.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1047\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/enter-root-password-zsh-path.png\" alt=\"command changes default shell to zsh for current user\" width=\"800\" height=\"150\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/enter-root-password-zsh-path.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/enter-root-password-zsh-path-300x56.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/enter-root-password-zsh-path-150x28.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/enter-root-password-zsh-path-768x144.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/enter-root-password-zsh-path-100x19.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/enter-root-password-zsh-path-700x131.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<p>The command switches the current user&#8217;s default shell to Zsh. Log out of the terminal and then back in to use the Z Shell.<\/p>\n<h2>Install Oh My Zsh<\/h2>\n<p>Oh My Zsh is an open-source framework that enhances the Z Shell&#8217;s capabilities and functionality. The command-line experience will be improved, making it more fun and effective. Oh My Zsh offers a selection of installed. Also maintained themes, plugins, and scripts.<\/p>\n<p>By Running the below command to Install Oh my Zsh:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sh -c \"$(wget https:\/\/raw.github.com\/ohmyzsh\/ohmyzsh\/master\/tools\/install.sh -O -)\"<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1048\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/running-command-install-oh-my-zsh.png\" alt=\"installing oh my zsh to customize shell in linux\" width=\"800\" height=\"458\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/running-command-install-oh-my-zsh.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/running-command-install-oh-my-zsh-300x172.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/running-command-install-oh-my-zsh-150x86.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/running-command-install-oh-my-zsh-768x440.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/running-command-install-oh-my-zsh-100x57.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/running-command-install-oh-my-zsh-700x401.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<p>You are prompted by the installer to make Zsh your default shell after the installation is complete. If you wish Zsh to be the default shell, type y; otherwise, type n to keep the current one. After installing the framework, you may begin modifying your prompt.<\/p>\n<h4>Add Your Theme<\/h4>\n<p>There are more than 150 terminal themes accessible once Oh My Zsh has been installed. On the Oh My Zsh GitHub theme page, you can view the names and visual representations of each theme. Following the instructions below, you can add the theme you&#8217;ve chosen to your terminal once you&#8217;ve done that:<\/p>\n<p>1. Open a text editor and make changes to the .zshrc configuration file. We&#8217;ll utilize nano as an illustration.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">nano ~\/.zshrc<\/pre>\n<p>2. Find the line that reads:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">ZSH_THEME=\"robbyrussell\"<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1049\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/changing-z-shell-theme.png\" alt=\"defines which theme the terminal uses\" width=\"800\" height=\"551\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/changing-z-shell-theme.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/changing-z-shell-theme-300x207.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/changing-z-shell-theme-150x103.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/changing-z-shell-theme-768x529.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/changing-z-shell-theme-100x69.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/changing-z-shell-theme-653x450.png 653w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<p>The line specifies the terminal&#8217;s current theme. Robby Russell is the default. Change the value to correspond with the desired theme&#8217;s name to use a different one. For instance:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">ZSH_THEME=\"jonathan\"<\/pre>\n<p>3. To load the theme, save the file and restart the terminal:<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1050\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/save-file-restart-terminal-load-theme.png\" alt=\"terminal uses specified theme\" width=\"800\" height=\"190\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/save-file-restart-terminal-load-theme.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/save-file-restart-terminal-load-theme-300x71.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/save-file-restart-terminal-load-theme-150x36.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/save-file-restart-terminal-load-theme-768x182.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/save-file-restart-terminal-load-theme-100x24.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/save-file-restart-terminal-load-theme-700x166.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<p>The desired theme is now applied to the terminal.<\/p>\n<h4>Auto-Suggestions Enabled<\/h4>\n<p>To receive command suggestions based on your previous Zsh commands, enable the auto-suggestions plugin. Getting auto-suggestions helps you do your everyday duties faster and saves time because we use some commands frequently.<\/p>\n<p>To enable auto-suggestions, take the following actions:<\/p>\n<p>1. Add the plugin repository for auto-suggestions first. To clone the repository, execute the following command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">git https:\/\/github.com\/zsh-users\/zsh-autosuggestions ${ZSH_CUSTOM:-~\/.oh-my-zsh\/custom}\/plugins\/zsh-autosuggestions<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1051\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/add-auto-suggestion-plugin-repository.png\" alt=\"command to clone the repository\" width=\"800\" height=\"291\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/add-auto-suggestion-plugin-repository.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/add-auto-suggestion-plugin-repository-300x109.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/add-auto-suggestion-plugin-repository-150x55.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/add-auto-suggestion-plugin-repository-768x279.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/add-auto-suggestion-plugin-repository-100x36.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/add-auto-suggestion-plugin-repository-700x255.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>2. Using a text editor, open the .zshrc configuration file:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">nano ~\/.zshrc<\/pre>\n<p>3. Add the auto-suggestion plugin to the plugins section of the file by scrolling down and doing as follows:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">plugins=(git zsh-autosuggestions)<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1052\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/activate-auto-suggestion-plugin.png\" alt=\"command displays Scroll down plugins section file\" width=\"800\" height=\"311\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/activate-auto-suggestion-plugin.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/activate-auto-suggestion-plugin-300x117.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/activate-auto-suggestion-plugin-150x58.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/activate-auto-suggestion-plugin-768x299.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/activate-auto-suggestion-plugin-100x39.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/activate-auto-suggestion-plugin-700x272.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<p>4. Save your changes and close the editor.<\/p>\n<p>5. To enable the auto-suggestions plugin, restart Zsh and the terminal.<\/p>\n<p>Use the right arrow key to accept the recommendation and have the command finished for you as you type:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1053\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/right-arrow-key-accept-suggetion.png\" alt=\"type command use right arrow key\" width=\"800\" height=\"151\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/right-arrow-key-accept-suggetion.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/right-arrow-key-accept-suggetion-300x57.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/right-arrow-key-accept-suggetion-150x28.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/right-arrow-key-accept-suggetion-768x145.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/right-arrow-key-accept-suggetion-100x19.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/right-arrow-key-accept-suggetion-700x132.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<h4>Set Syntax Highlighting On\/Enable<\/h4>\n<p>Numerous advantages come from syntax highlighting, such as increased readability of the code, mistake detection, language recognition, productivity, and aesthetics.<\/p>\n<p>To add syntax highlighting to Zsh, take the following actions:<\/p>\n<p>1. Clone the plugin repository by using the command line interface as follows:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">git clone https:\/\/github.com\/zsh-users\/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~\/.oh-my-zsh\/custom}\/plugins\/zsh-syntax-highlighting<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1054\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/enable-syntax-highlighting.png\" alt=\"run command to clone the plugin repository\" width=\"800\" height=\"291\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/enable-syntax-highlighting.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/enable-syntax-highlighting-300x109.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/enable-syntax-highlighting-150x55.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/enable-syntax-highlighting-768x279.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/enable-syntax-highlighting-100x36.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/enable-syntax-highlighting-700x255.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<p>2. Access the file named.zshrc:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">nano ~\/.zshrc<\/pre>\n<p>3. Add zsh-syntax-highlighting to the list of plugins by navigating to the plugins section and scrolling down:<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1055\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/list-of-plugins.png\" alt=\"command display list of plugins\" width=\"800\" height=\"251\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/list-of-plugins.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/list-of-plugins-300x94.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/list-of-plugins-150x47.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/list-of-plugins-768x241.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/list-of-plugins-100x31.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/list-of-plugins-700x220.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<p>4. Save your changes and close the document.<\/p>\n<p>5. To enable syntax highlighting, restart the terminal and launch Zsh. For instance, typing a command incorrectly highlights it in red, while typing it correctly highlights it in green:<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1056\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/restart-terminal-start-zsh.png\" alt=\"echo command to show how highlighting works\" width=\"800\" height=\"191\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/restart-terminal-start-zsh.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/restart-terminal-start-zsh-300x72.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/restart-terminal-start-zsh-150x36.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/restart-terminal-start-zsh-768x183.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/restart-terminal-start-zsh-100x24.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/restart-terminal-start-zsh-700x167.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<p>In the preceding example, we used the echo command to demonstrate how highlighting functions.<\/p>\n<h3>Eliminate Zsh<\/h3>\n<p>If you choose to uninstall Zsh and go back to the previous shell, take the following actions:<\/p>\n<p>1. Run the following command to remove the zsh package from the computer:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo apt --purge remove zsh<\/pre>\n<p>When prompted, enter y and then If you want to Remove Zsh please press Enter.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1057\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/remove-zsh-purge-package.png\" alt=\"Purge zsh package from system running command\" width=\"800\" height=\"450\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/remove-zsh-purge-package.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/remove-zsh-purge-package-300x169.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/remove-zsh-purge-package-150x84.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/remove-zsh-purge-package-768x432.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/remove-zsh-purge-package-100x56.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/remove-zsh-purge-package-700x394.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<p>A package&#8217;s dependencies and any associated configuration files are also deleted when it is purged, along with the package itself.<\/p>\n<p>2. Return Bash (or any other shell you want) to the default position:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">chsh -s $(which bash)<\/pre>\n<p>3. To make the modifications effective, close the terminal and start a fresh session.<\/p>\n<h3>Final words on Installing and Setup Zsh in Ubuntu<\/h3>\n<p>For your command-line interactions, integrating Zsh into your Ubuntu environment can be a game-changer. It is a favorite among developers and power users due to its extensibility. Also, Potent auto-completion, and customization options. You&#8217;ve learned how to install Zsh on your Ubuntu system here. Which opens the door to a command-line experience that is more effective and pleasant. By Installing Samba on Ubuntu, you can <a href=\"https:\/\/www.dedicatedcore.com\/blog\/install-samba-ubuntu\/\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">enable absolute file sharing<\/a> across different OS that provides efficient help management in your local network.<\/p>\n<p>You may now further customize your shell to match your unique demands. Increase your productivity in the Linux environment. The Zsh shell for Ubuntu was installed and set up using the instructions in this article. Zsh is gaining popularity even though Bash is still used. It&#8217;s frequently used as the default shell on Linux systems.<\/p>\n<h3>Frequently Asked Questions (FAQ)<\/h3>\n<p><strong>1. How do I Install Zsh on Ubuntu?<\/strong><\/p>\n<p>For Installing Zsh on Ubuntu with the following commands:<\/p>\n<p>Updating the package list with:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo apt update<\/pre>\n<p>Installing Zsh with:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo apt install zsh<\/pre>\n<p><strong>2. How do I Update Zsh or Oh My Zsh?<\/strong><\/p>\n<p>Update Zsh with the following command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo apt update &amp;&amp; sudo apt upgrade zsh<\/pre>\n<p>Update Oh My Zsh by Running the following command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">omz update<\/pre>\n<p><strong>3. How do I Enable Auto-Suggestions in Zsh?<\/strong><\/p>\n<p>Enable Auto-Suggestions in Zsh:<\/p>\n<p>install the <strong>zsh-autosuggestions<\/strong> plugin and add it to the plugins section in <strong>.zshrc<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The abbreviation Zsh stands for Z Shell, a robust and customizable command-line shell. That provides several features and enhancements over Bash by default. Zsh can&#8230;<\/p>\n","protected":false},"author":1,"featured_media":1080,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/posts\/1040"}],"collection":[{"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/comments?post=1040"}],"version-history":[{"count":18,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/posts\/1040\/revisions"}],"predecessor-version":[{"id":2687,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/posts\/1040\/revisions\/2687"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/media\/1080"}],"wp:attachment":[{"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/media?parent=1040"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/categories?post=1040"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/tags?post=1040"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}