Introduction

The sh shell is all well and good, but anyone who works a lot with the console will miss a lot. In particular, a proper autocomplete and a meaningful history make daily life much easier. The z-shell is a good basis, but with the package ohmyzsh it's even more fun. The zsh and ohmyzsh are quickly installed after adapting the package source with pkg install -y zsh ohmyzsh.

NEW: For the very impatient I have a console only section. There are only commands, no explanations.

Last update:

  • 16.11.2024: Initial document.

With chsh -s zsh USERNAME the zsh can be assigned to another user as a shell. chsh -s zsh itself. A supplied configuration is already well equipped and copied to your own user directory with cp /usr/local/share/ohmyzsh/templates/zshrc.zsh-template ~/.zshrc. This becomes active at the next login.

The autocomplete function provides exciting simplifications

  • Commands and their options with {TAB}
  • History with up/down arrow, also filtered by the first characters
➜  ~ pkg in{TAB}
info    -- display information about installed packages
install -- install packages from remote package repositories

➜  ~ pkg delete lib{TAB}
libevent-2.1.12  libffi-3.4.6     libiconv-1.17_1

➜  ~ cd /usr/local/{TAB}
lib/      lib32/    libdata/  libexec/  local/

Console

pkg install -y zsh ohmyzsh
chsh -s zsh USERNAME
chsh -s zsh
cp /usr/local/share/ohmyzsh/templates/zshrc.zsh-template ~/.zshrc
logout