{"id":23422,"date":"2018-05-23T08:00:45","date_gmt":"2018-05-23T08:00:45","guid":{"rendered":"https:\/\/fedoramagazine.org\/?p=19630"},"modified":"2018-05-23T08:00:45","modified_gmt":"2018-05-23T08:00:45","slug":"set-up-zsh-on-your-fedora-system","status":"publish","type":"post","link":"https:\/\/sickgaming.net\/blog\/2018\/05\/23\/set-up-zsh-on-your-fedora-system\/","title":{"rendered":"Set up zsh on your Fedora system"},"content":{"rendered":"<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&#8217;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.\u00a0 However, it isn&#8217;t the only shell available; several other shells can be installed. This article focuses on the Z Shell, or\u00a0<em>zsh<\/em>.<\/p>\n<p><span id=\"more-19630\"><\/span><\/p>\n<p>Bash is a rewrite of the old Bourne shell (<em>sh<\/em>) that shipped in UNIX. Zsh\u00a0is intended to be friendlier than bash, through better interaction. Some of its useful features are:<\/p>\n<ul>\n<li>Programmable command line completion<\/li>\n<li>Shared command history between running shell sessions<\/li>\n<li>Spelling correction<\/li>\n<li>Loadable modules<\/li>\n<li>Interactive selection of files and folders<\/li>\n<\/ul>\n<p>Zsh is available in the Fedora repositories. To install, run this command:<\/p>\n<pre>$ sudo dnf install zsh<\/pre>\n<h3>Using zsh<\/h3>\n<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>\n<div id=\"attachment_21387\" style=\"width: 743px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" 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>\n<p class=\"wp-caption-text\">First-run wizard<\/p>\n<\/div>\n<p>If you type 1 the configuration wizard starts. The other options launch the shell immediately.<\/p>\n<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>\n<div id=\"attachment_21386\" style=\"width: 743px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" 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>\n<p class=\"wp-caption-text\">Using the auto-completion feature with the\u00a0<em>cd<\/em> command<\/p>\n<\/div>\n<p>Another interesting feature is spelling correction, which helps when writing filenames with mixed cases:<\/p>\n<div id=\"attachment_21420\" style=\"width: 745px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" 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>\n<p class=\"wp-caption-text\">Auto completion performing spelling correction<\/p>\n<\/div>\n<h2>Making zsh your default shell<\/h2>\n<p>Zsh offers a lot of plugins, like zsh-syntax-highlighting, and the famous &#8220;Oh my zsh&#8221; (<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\u00a0<em>chsh<\/em>\u00a0(&#8220;change shell&#8221;) command:<\/p>\n<pre>$ chsh -s $(which zsh)<\/pre>\n<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>\n<hr \/>\n<p>Photo by <a href=\"https:\/\/www.flickr.com\/photos\/katerha\/\">Kate Ter Haar<\/a>\u00a0from <a href=\"https:\/\/www.flickr.com\/photos\/katerha\/34714051013\/\">Flickr<\/a>\u00a0(CC BY-SA).<\/p>\n","protected":false},"excerpt":{"rendered":"<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 shell, so called because it wraps around the kernel. The shell is a text-based interface that lets you run commands on the system. It&#8217;s also sometimes called a command line [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":23423,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48],"tags":[87,88,89,90,91,45,43,46,47,92,77,93,44],"class_list":["post-23422","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-fedora-os","tag-advanced","tag-cli","tag-command-line","tag-customize","tag-features","tag-fedora","tag-for-system-administrators","tag-magazine","tag-news","tag-shell","tag-software","tag-terminal","tag-using-software"],"_links":{"self":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts\/23422","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/comments?post=23422"}],"version-history":[{"count":0,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts\/23422\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/media\/23423"}],"wp:attachment":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/media?parent=23422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/categories?post=23422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/tags?post=23422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}