Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fedora - Set up zsh on your Fedora system

#1
Set up zsh on your Fedora system

<div style="margin: 5px 5% 10px 5%;"><img src="http://www.sickgaming.net/blog/wp-content/uploads/2018/06/set-up-zsh-on-your-fedora-system.gif" width="733" height="498" title="" alt="" /></div><div><p>For some people, the terminal can be scary. But a terminal is more than just a black screen to type in. It usually runs a <em>shell</em>, so called because it wraps around the kernel. The shell is a text-based interface that lets you run commands on the system. It’s also sometimes called a command line interpreter or <em>CLI</em>. Fedora, like most Linux distributions, comes with <em>bash</em> as the default shell.  However, it isn’t the only shell available; several other shells can be installed. This article focuses on the Z Shell, or <em>zsh</em>.</p>
<p><span id="more-19630"></span></p>
<p>Bash is a rewrite of the old Bourne shell (<em>sh</em>) that shipped in UNIX. Zsh is intended to be friendlier than bash, through better interaction. Some of its useful features are:</p>
<ul>
<li>Programmable command line completion</li>
<li>Shared command history between running shell sessions</li>
<li>Spelling correction</li>
<li>Loadable modules</li>
<li>Interactive selection of files and folders</li>
</ul>
<p>Zsh is available in the Fedora repositories. To install, run this command:</p>
<pre>$ sudo dnf install zsh</pre>
<h3>Using zsh</h3>
<p>To start using it, just type <em>zsh</em> and the new shell prompts you with a first run wizard. This wizard helps you configure initial features, like history behavior and auto-completion. Or you can opt to keep the <a href="https://en.wikipedia.org/wiki/Configuration_file">rc file</a> empty:</p>
<div id="attachment_21387" style="width: 743px" class="wp-caption aligncenter"><img class="size-full wp-image-21387" src="http://www.sickgaming.net/blog/wp-content/uploads/2018/06/set-up-zsh-on-your-fedora-system.gif" alt="zsh First Run Wizzard" width="733" height="498" /></p>
<p class="wp-caption-text">First-run wizard</p>
</div>
<p>If you type 1 the configuration wizard starts. The other options launch the shell immediately.</p>
<p>Note that the user prompt is <strong>%</strong> and not <strong>$</strong> as with bash. A significant feature here is the auto-completion that allows you to move among files and directories with the <em>Tab</em> key, much like a menu:</p>
<div id="attachment_21386" style="width: 743px" class="wp-caption aligncenter"><img class="size-full wp-image-21386" src="http://www.sickgaming.net/blog/wp-content/uploads/2018/06/set-up-zsh-on-your-fedora-system-1.gif" alt="zsh cd Feature" width="733" height="498" /></p>
<p class="wp-caption-text">Using the auto-completion feature with the <em>cd</em> command</p>
</div>
<p>Another interesting feature is spelling correction, which helps when writing filenames with mixed cases:</p>
<div id="attachment_21420" style="width: 745px" class="wp-caption aligncenter"><img class="size-full wp-image-21420" src="http://www.sickgaming.net/blog/wp-content/uploads/2018/06/set-up-zsh-on-your-fedora-system-2.gif" alt="zsh Auto Completion" width="735" height="500" /></p>
<p class="wp-caption-text">Auto completion performing spelling correction</p>
</div>
<h2>Making zsh your default shell</h2>
<p>Zsh offers a lot of plugins, like zsh-syntax-highlighting, and the famous “Oh my zsh” (<a href="http://ohmyz.sh/">check out its page here</a>). You might want to make it the default, so it runs whenever you start a session or open a terminal. To do this, use the <em>chsh</em> (“change shell”) command:</p>
<pre>$ chsh -s $(which zsh)</pre>
<p>This command tells your system that you want to set (<em>-s</em>) your default shell to the correct location of the shell (<em>which zsh</em>).</p>
<hr />
<p>Photo by <a href="https://www.flickr.com/photos/katerha/">Kate Ter Haar</a> from <a href="https://www.flickr.com/photos/katerha/34714051013/">Flickr</a> (CC BY-SA).</p>
</div>
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Fedora - Contribute to Fedora 39 Upgrade, Virtualization, and Cloud Test Day xSicKxBot 0 2,071 09-30-2023, 03:56 AM
Last Post: xSicKxBot
  Fedora - Share your game achievements with Gamerzilla xSicKxBot 0 1,027 09-27-2023, 09:59 AM
Last Post: xSicKxBot
  Fedora - Using Cockpit to graphically manage systems, without installing Cockpit on xSicKxBot 0 912 09-26-2023, 06:41 AM
Last Post: xSicKxBot
  Fedora - Announcing Fedora Linux 39 Beta xSicKxBot 0 935 09-20-2023, 09:48 AM
Last Post: xSicKxBot
  Fedora - Contribute at Passkey Auth, Fedora CoreOS and IoT Test Week xSicKxBot 0 911 09-19-2023, 12:23 PM
Last Post: xSicKxBot
  Fedora - Quick Fedora shirt update and sale of last stock with the old logo xSicKxBot 0 970 09-16-2023, 12:28 PM
Last Post: xSicKxBot
  Fedora - Contribute at the Fedora Linux Test Week for Kernel 6.5 and Toolbx Test Day xSicKxBot 0 976 09-11-2023, 02:47 PM
Last Post: xSicKxBot
  Fedora - Fedora Linux Flatpak cool apps to try for September xSicKxBot 0 949 09-10-2023, 04:59 PM
Last Post: xSicKxBot
  Fedora - Contribute at the Test Week for the Anaconda WebUI Installer for Fedora Wor xSicKxBot 0 954 09-09-2023, 11:54 PM
Last Post: xSicKxBot
  Fedora - Docs workshop: Virtually writing together xSicKxBot 0 997 09-09-2023, 05:08 AM
Last Post: xSicKxBot

Forum Jump:


Users browsing this thread:

Forum software by © MyBB Theme © iAndrew 2016