Sie befinden sich im Service: RWTH High Performance Computing (Linux)

Configuration hints for the Z shell (zsh)

Configuration hints for the Z shell (zsh)

How to change the shell

All users get the Z shell (zsh) as their default login shell. Users who would like to work with a different shell (bash in the following example) should append the following lines of code to the end of their ~/.zshrc:

source /usr/local_host/etc/switch_login_shell bash

You also have to add the line

. /usr/local_host/etc/bashrc

to your ~/.bashrc file in order to activate the modules package, cf. here.


zsh configuration files

zsh has a couple of configuration files. The most important ones are described in the following subsections.


This file is read whenever zsh is started as an interactive shell. Therefore you should use it in order to configure the interactive behaviour of your shell, e.g. for

  • permanently needed software modules (for example for abaqus: module load abaqus)
  • environment variables like EDITOR, PAGER, extensions to MANPATH
  • aliases
  • shell options (setopt ...)

To switch the command-line mode from 'emacs' (the default) to 'vi' use the following line:

bindkey -v


This file is read for every invocation of zsh and should therefore be as short as possible.

~/.zshenv must not contain any output to stdout, otherwise various programs (e.g. scp) will stop working. Moreover, you must not call any external zsh scripts here. An infinite recursion will occur otherwise.

At best, you should avoid calling external programs at all and limit yourself to the definition of environment variables only, e.g. extensions to PATH.


This file is read whenever a zsh login shell terminates.

zuletzt geändert am 14.07.2022

Wie hat Ihnen dieser Inhalt geholfen?

Creative Commons Lizenzvertrag
Dieses Werk ist lizenziert unter einer Creative Commons Namensnennung - Weitergabe unter gleichen Bedingungen 3.0 Deutschland Lizenz