Shell

A shell is Article description::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

NamePackageHomepageDescription
bashapp-shells/bashhttps://tiswww.case.edu/php/chet/bash/bashtop.htmlThe Bourne Again Shell, is the default shell on Gentoo. It is used by Portage, Gentoo's default package manager.
dashapp-shells/dashhttp://gondor.apana.org.au/~herbert/dash/The Debian Almquist Shell, a small, fast, and posix-compliant shell suited for startup scripts (as /bin/sh replacement).
fishapp-shells/fishhttps://fishshell.com/The Friendly Interactive SHell.
kshapp-shells/kshhttp://www.kornshell.com/The Original Korn Shell, 1993 revision (ksh93).
mkshapp-shells/mkshhttps://www.mirbsd.org/mksh.htmAn actively developed free implementation of the Korn Shell, and well suited for scripting.
tcshapp-shells/tcshhttp://www.tcsh.org/an enhanced version of the Berkeley C Shell (csh).
xonshdev-python/xonshhttp://xon.sh/A Python-based shell that falls back to bash commands.
zshapp-shells/zshhttp://www.zsh.org/An advanced shell that is the chosen interactive shell for many users.
Note
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

Configuration

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 — is a primer which explains various aspects of a login shell.
This article is issued from Gentoo. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.