Shell
Ninereasons (Talk | contribs) |
|||
(8 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | Command interpreters ('''shells''') allow programs and users to interface with the "kernel" (lower level of the operating system). Microsoft Windows users will compare the '''Unix shell''' to DOS. | |
− | + | Unix shells are traditionally CLIs (Command Line Interface) where users can type [[:Category:System Commands|system commands]] to run programs and/or manipulate files and directories, within the bounds of your [[user context]]. A CLI shell provides a command language and utilities that you can use on the command line; or, to perform more complex tasks you can save a series of shell commands in files ([[shell script]]s), which can be executed from the command line or by other scripts or programs (Windows users will compare shell scripts to ''batch files''). | |
− | + | A shell can also be a GUI (Graphical User Interface). Examples of '''GUI shells''' are the X Windows System of Unix, the Window OS of Microsoft, and the Mac OS. CLI interfaces are available in Unix-like GUI environments through terminal emulator programs like [[xterm]] or [[rxvt]]. In Windows, a CLI is provided by <code>command.com</code> or <code>cmd.exe</code>. A DOS or Windows CLI prompt usually ends with <code>></code>. | |
+ | |||
+ | ==Shell families== | ||
+ | The first generation shell was called <code>sh</code>, developed for Unix 1 by Ken Thompson at Bell Labs, in 1971. In the second generation, the Unix shell was re-written in two different directions: the [[Bourne shell]] (<code>sh</code>) and the [[C shell]] (<code>csh</code>). The Bourne shell initially focused on standardizing a builtin command set. The C shell focused on C language syntax, and user-friendly improvements such as file name completion and command line editing. FreeBSD uses a Bourne shell ([[sh]]) for its default system command interpreter, and a C shell ([[tcsh]]) for the default login shell. | ||
+ | |||
+ | Steve Bourne developed [[sh]] for Unix 7, at Bell Labs in 1978. Third generation improvements of the Bourne shell include the [[ksh|Korn shell]] (<code>ksh</code> by Dave Korn, early 1980s), and the [[bash|Bourne again shell]] (<code>bash</code> by Brian Fox in 1987 - a very popular, very user-friendly third generation shell, familiar to users of Linux, Apple Mac OS X (in the Terminal utility), and [http://www.cygwin.com Cygwin]). Bourne shell derivatives have a default CLI prompt that ends with <code>$</code>. The version of <code>sh</code> used by FreeBSD as the default command interpreter is similar to (but not the same as) the Korn shell. | ||
+ | |||
+ | Bill Joy (the creator of BSD) developed [[csh]] for BSD in 1979. Ken Greer also made improvements to the C Shell in the 1970s, called the [[tcsh|TENEX C shell]] (<code>tcsh</code>). Versions of the C shell usually have a default CLI prompt that ends with <code>%</code> (csh) or <code>></code> (tcsh). The <code>csh</code> used by FreeBSD is actually <code>tcsh</code>, which is the default [[login shell]]. | ||
+ | |||
+ | ==Alternative shells== | ||
+ | Besides the default shells ([[sh]] and [[tcsh]]), and the ports mentioned above ([[ksh]] and [[bash]]), there are a number of other powerful CLI shells available from the [[Ports|ports collection]]. Below are just a few shells that could serve as your primary login shell. | ||
+ | * [[psh]] — combines aspects of bash and other shells with [[perl]] extensions, so that a variety of perl commands can be executed directly from the command line or in scripts. | ||
+ | * [[scsh]] — provides Scheme language extensions, so that a variety of scheme code can be executed directly from the command line or in scripts. | ||
+ | * [[zsh]] — a shell that combines many features of both, the C shell and Bourne shell, and adds powerful scripting language features of its own. | ||
+ | |||
+ | To change your login shell from one to another, install the alternative shell from the [[Ports tree]] and run the [[chsh]] command. | ||
+ | |||
+ | [[Category:Shells]] [[Category:FreeBSD Terminology]] |
Latest revision as of 16:36, 7 June 2006
Command interpreters (shells) allow programs and users to interface with the "kernel" (lower level of the operating system). Microsoft Windows users will compare the Unix shell to DOS.
Unix shells are traditionally CLIs (Command Line Interface) where users can type system commands to run programs and/or manipulate files and directories, within the bounds of your user context. A CLI shell provides a command language and utilities that you can use on the command line; or, to perform more complex tasks you can save a series of shell commands in files (shell scripts), which can be executed from the command line or by other scripts or programs (Windows users will compare shell scripts to batch files).
A shell can also be a GUI (Graphical User Interface). Examples of GUI shells are the X Windows System of Unix, the Window OS of Microsoft, and the Mac OS. CLI interfaces are available in Unix-like GUI environments through terminal emulator programs like xterm or rxvt. In Windows, a CLI is provided by command.com
or cmd.exe
. A DOS or Windows CLI prompt usually ends with >
.
[edit] Shell families
The first generation shell was called sh
, developed for Unix 1 by Ken Thompson at Bell Labs, in 1971. In the second generation, the Unix shell was re-written in two different directions: the Bourne shell (sh
) and the C shell (csh
). The Bourne shell initially focused on standardizing a builtin command set. The C shell focused on C language syntax, and user-friendly improvements such as file name completion and command line editing. FreeBSD uses a Bourne shell (sh) for its default system command interpreter, and a C shell (tcsh) for the default login shell.
Steve Bourne developed sh for Unix 7, at Bell Labs in 1978. Third generation improvements of the Bourne shell include the Korn shell (ksh
by Dave Korn, early 1980s), and the Bourne again shell (bash
by Brian Fox in 1987 - a very popular, very user-friendly third generation shell, familiar to users of Linux, Apple Mac OS X (in the Terminal utility), and Cygwin). Bourne shell derivatives have a default CLI prompt that ends with $
. The version of sh
used by FreeBSD as the default command interpreter is similar to (but not the same as) the Korn shell.
Bill Joy (the creator of BSD) developed csh for BSD in 1979. Ken Greer also made improvements to the C Shell in the 1970s, called the TENEX C shell (tcsh
). Versions of the C shell usually have a default CLI prompt that ends with %
(csh) or >
(tcsh). The csh
used by FreeBSD is actually tcsh
, which is the default login shell.
[edit] Alternative shells
Besides the default shells (sh and tcsh), and the ports mentioned above (ksh and bash), there are a number of other powerful CLI shells available from the ports collection. Below are just a few shells that could serve as your primary login shell.
- psh — combines aspects of bash and other shells with perl extensions, so that a variety of perl commands can be executed directly from the command line or in scripts.
- scsh — provides Scheme language extensions, so that a variety of scheme code can be executed directly from the command line or in scripts.
- zsh — a shell that combines many features of both, the C shell and Bourne shell, and adds powerful scripting language features of its own.
To change your login shell from one to another, install the alternative shell from the Ports tree and run the chsh command.