interactive shell
A shell reading commands from you at a terminal, as opposed to a non-interactive shell running a script.
In more detail
Some features only switch on interactively: aliases, history expansion with the exclamation mark, job control and the prompt. That is why an alias that works at the prompt does nothing inside a script. Startup files differ too: an interactive shell reads your .bashrc and a script does not.
Related terms
- shell alias — A short name the shell swaps in for the start of a command line, defined with alias name='command'.
- history expansion — Interactive shortcuts starting with an exclamation mark that reuse earlier commands, such as a double exclamation mark for the whole previous line.
- .bashrc — A file in your home directory that every new interactive bash reads at startup, used for aliases, functions and prompt settings.
- job control — The shell feature for managing the commands it started: listing them with jobs, and moving them between foreground and background with fg and bg.
Taught in
- What A Shell Is, And What Bash Is — Bash Scripting & Command Line Automation
- Help, History, Completion And Aliases — Bash Scripting & Command Line Automation
- Shell Variables, The Environment And export — Bash Scripting & Command Line Automation
- Processes, Jobs And Signals — Bash Scripting & Command Line Automation