From Gentoo Wiki
Jump to:navigation Jump to:search

A shell is a command-line interpreter that offers a text-based interface to users. It can be used as command-line interface (CLI) on a terminal emulator or as a script interpreter running in the background.

Typically the shell is the first program started after a user logs in at a terminal. The /etc/passwd file contains information on the default shell for each user on the system.

Available software

Name Package Homepage Description
bash app-shells/bash The Bourne Again Shell, is the default shell on Gentoo. It is used by Portage, Gentoo's default package manager.
dash app-shells/dash The Debian Almquist Shell, a small, fast, and posix-compliant shell suited for startup scripts (as /bin/sh replacement).
fish app-shells/fish The Friendly Interactive SHell.
ksh app-shells/ksh The Original Korn Shell, 1993 revision (ksh93).
mksh app-shells/mksh An actively developed free implementation of the Korn Shell, and well suited for scripting.
tcsh app-shells/tcsh an enhanced version of the Berkeley C Shell (csh).
xonsh dev-python/xonsh A Python-based shell that falls back to bash commands.
yash app-shells/yash Yet Another SHell, is a POSIX-compliant command line shell written in C99 (ISO/IEC 9899:1999).
zsh app-shells/zsh An advanced shell that is the chosen interactive shell for many users.
Many shell scripts reference the /bin/sh file; this is generally a symlink to the shell of choice.

For more shell options see the output of the following command (app-portage/eix required):

user $eix -cC app-shells


Changing the default system shell

System administrators can change the default system shell using the eselect utility.

If it is not installed, emerge the app-eselect/eselect-sh package:

root #emerge --ask app-eselect/eselect-sh

To list possible shell options use:

root #eselect sh list

To set dash as the default system shell:

root #eselect sh set dash

Changing a user's shell

The default shell for users can be changed on an individual basis using the chsh command. To change the default shell for the current user, type chsh and enter a correct path to the new shell. In the example below, a user named Larry the cow (Larry) is changing his default shell from /bin/bash to /bin/dash:

user $chsh
Changing the login shell for larry
Enter the new value, or press ENTER for the default
	Login Shell [/bin/bash]: /bin/dash

chsh can be used by the super user account to change the default shell for any user.

See also

  • Login — a primer which explains various aspects of a login shell.