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



Forum Jump:


Users browsing this thread:
2 Guest(s)

Forum software by © MyBB Theme © iAndrew 2016