Generated by GPT-5-mini| Common shell | |
|---|---|
| Name | Common shell |
| Type | Command-line shell |
| Developer | Various |
| Released | 1970s–present |
| Influenced by | Bourne shell, C shell, Plan 9 shell |
| Operating system | Unix-like systems, Linux, BSD, macOS, Windows (via subsystems) |
Common shell The Common shell is a family of command-line interpreters used on Unix-derived systems and other operating systems such as Linux, BSD, and macOS. It provides an interactive environment for users and a scripting language for system administrators and developers to automate tasks, manipulate files, and control processes. The shell sits between the user and the kernel to translate textual commands into system calls and program execution, integrating with utilities like awk, sed, grep, and make.
The Common shell encapsulates a command language, command execution semantics, input/output redirection, and job control. It interoperates with tools such as tar, ssh, rsync, scp, and ftp to perform administration, deployment, and backup workflows. Popular shells in this family share features with the Bourne shell, C shell, and newer designs from Plan 9; implementations target environments from desktop GNOME and KDE terminals to server distributions like Debian, Red Hat Enterprise Linux, and Ubuntu.
Shells evolved alongside Unix in laboratories and commercial vendors such as Bell Labs and companies like AT&T. Early influences include the Thompson shell and the Bourne shell created at Bell Labs by developers associated with projects like Research Unix. Concurrent developments such as the C shell at University of California, Berkeley introduced interactive features and scripting syntax that influenced later shells. Academic and industrial work at Plan 9 from Bell Labs and research at institutions like MIT and Carnegie Mellon University also guided features and reimplementations. Over decades, contributions from organizations including Free Software Foundation, OpenBSD, and NetBSD fostered portability and standards like the POSIX specifications.
Common shells adopt a modular architecture: a parser transforms textual commands into an abstract syntax, an execution engine handles processes and pipelines, and a job control subsystem manages foreground and background tasks. They interact with system interfaces such as the POSIX.1 API and system calls provided by kernels like the Linux kernel or XNU. Shells integrate lexical rules and syntactic constructs inspired by designs from Ken Thompson and Stephen Bourne and often include built-in commands for environment management, variable expansion, and control flow influenced by scripting languages from projects at Bell Labs and University of California, Berkeley.
Common shells provide command substitution, parameter expansion, wildcard globbing, redirection of stdin/stdout/stderr, pipelines, and control structures like if/then/else, for, while, and case. They incorporate job control using signals such as SIGINT and SIGCHLD and support for background execution with '&'. Advanced features include programmable completion popularized by projects such as Bash and interactive editing modes derived from GNU Readline and vi keybindings. Integration with system utilities like cron, systemd, and init enables scheduled and service-oriented automation across distributions from Red Hat to Arch Linux.
Notable implementations in this family include Bash from the GNU Project, the Bourne-compatible dash, the POSIX-oriented ksh (KornShell), the enhanced zsh, and platform-specific shells like skins used in Solaris and AIX. Projects such as BusyBox provide compact shell variants for embedded systems, while Windows support emerges through layers like the Windows Subsystem for Linux and ports maintained by communities including Cygwin. Research and niche implementations appear in projects at Plan 9 from Bell Labs and alternatives from groups like SUSv3 and SUSv4 contributors.
Common shell scripts often orchestrate pipelines combining find, xargs, sort, and uniq to process files, or use awk and sed for text transformations. Administrators automate backups with tools like rsync and tar while using ssh-based workflows with ssh and scp to manage remote hosts or integrate with Ansible playbooks. Development workflows include invoking make and compilers such as gcc or clang, running test suites managed by Autotools or CMake, and deploying artifacts to services like Docker and Kubernetes clusters. Example idioms include shebang lines referencing interpreters installed by distributions such as Debian or package systems like RPM and apt-get.
Shells have been the vector for vulnerabilities including command injection and environment manipulation exploits that affected systems in contexts involving web servers like Apache HTTP Server or CI systems such as Jenkins. Best practices promoted by organizations like the Open Web Application Security Project include avoiding unsanitized input, using full pathnames, employing least-privilege accounts managed by sudo and PAM, and using safer languages or restricted shells for untrusted inputs. Limitations include differences in behavior across implementations (notably between Bash, dash, ksh, and zsh), performance constraints for very large data pipelines, and portability issues addressed through standards like POSIX.
Category:Command shells