subshell
also: child shell, nested shell
A subshell is a child shell process spawned by the current shell, which runs commands in an isolated environment and inherits variables from its parent but cannot modify the parent's state.
A subshell is a new instance of the shell that runs as a child process of the current shell. When you execute a command in a subshell, it inherits the parent shell's environment variables and settings, but any changes made within the subshell (like variable assignments or directory changes) do not affect the parent shell.
Subshells are created explicitly using parentheses () or implicitly by piping commands, background processes, or command substitution. For example, (cd /tmp; pwd) runs the commands in a subshell, so the parent shell's working directory remains unchanged.
A common use case is protecting the parent environment from side effects: VAR=value (echo $VAR) sets VAR only within the subshell. Without parentheses, VAR=value; echo $VAR would set VAR in the current shell permanently.