login shell
The shell your account starts when you log in, recorded in the user database and shown by the SHELL variable.
In more detail
The SHELL variable keeps naming your login shell even after you start a different shell, so it cannot tell you which shell you are in now; ask ps -p $$ instead. Change your login shell with chsh -s, and only to a path listed in /etc/shells.
Example
echo "$SHELL"Related terms
- chsh — The command that changes your login shell to another program listed in /etc/shells.
- /etc/shells — A system file listing the full paths of programs allowed as login shells.
- dollar zero — The special parameter $0, which holds the name the current shell or script was started as.
- user account — The record that lets a person or service use a Linux system, tying a login name to a UID, a primary group, a home directory and a login shell.
- shell — The program that reads the commands you type, runs them and shows the results; sh and bash are common ones.
- /etc/passwd — The world-readable file that lists local accounts, one per line: name, UID, GID, description, home directory and login shell, separated by colons.
- login session — The period from logging in to logging out, during which your processes carry the identity and group memberships you had at login.
Taught in
- Which Shell Am I In, And Getting Bash Five — Bash Scripting & Command Line Automation
- Reshaping Text: cut, sort, uniq, tr, sed, awk — Bash Scripting & Command Line Automation
- Script Input And Output: read, Heredocs, printf — Bash Scripting & Command Line Automation
- eval, And What To Use Instead — Bash Scripting & Command Line Automation
- Users, UIDs And The Password File — Linux Fundamentals & Systems Administration