View on GitHub

my-linux-scripts

Ways to switch between available shell implementations (zsh, bash, fish, etc.)

Temporarily switch to bash in current terminal session

Bash has to be in the system PATH, if not “/bin/bash” should be used instead.

exec bash

Temporarily switch to zsh in current terminal session

Zsh has to be in the system PATH, if not “/bin/bash” should be used instead.

exec zsh

Permanently switch default shell

List all available shells:

cat /etc/shells

Select one shell as default shell from the options above - here for “bash”:

chsh -s /bin/bash

Close and restart your terminal emulator. If that does not work a reboot is required to finalize the switching of shells.

Attention

After switching to a new shell the configurations and settings of your old shell are not included anymore.
So some applications (for instance those which are installed via snap or flatpak) are not discoverable anymore.
And as the system uses the shell for various tasks these missing link can appear systemwide.

Examples:

Example ( from bash -> zsh )

sudo nano /etc/zsh/zprofile
emulate sh -c 'source /etc/profile'

If you like the article consider dropping me a coffee

paypal