Difference between revisions of "Command-line shell"

From ArchWiki
Jump to: navigation, search
m (Link correction.)
(List of shells: add Nash)
 
(27 intermediate revisions by 16 users not shown)
Line 1: Line 1:
 
[[Category:Command shells]]
 
[[Category:Command shells]]
{{stub|This article is meant to be a general introduction to command shells. Existing shells should be briefly mention here.}}
+
[[ja:コマンドシェル]]
 +
[[ru:Command-line shell]]
 
From [[Wikipedia:Unix shell|Wikipedia]]:
 
From [[Wikipedia:Unix shell|Wikipedia]]:
: ''A Unix shell is a command-line interpreter or shell that provides a traditional user interface for the Unix operating system and for Unix-like systems. Users direct the operation of the computer by entering commands as text for a command line interpreter to execute or by creating text scripts of one or more such commands.''
+
:A Unix shell is a command-line interpreter or shell that provides a traditional user interface for the Unix operating system and for Unix-like systems. Users direct the operation of the computer by entering commands as text for a command line interpreter to execute or by creating text scripts of one or more such commands.
  
 
== List of shells ==
 
== List of shells ==
  
* {{App|[[Bash]]|Shell, or command language interpreter, that will appear in the GNU operating system. Bash is an sh-compatible shell that incorporates useful features from the Korn shell (ksh) and C shell (csh). It is intended to conform to the IEEE POSIX P1003.2/ISO 9945.2 Shell and Tools standard. It offers functional improvements over sh for both programming and interactive use. In addition, most sh scripts can be run by Bash without modification.|https://www.gnu.org/software/bash/|{{Pkg|bash}}}}
+
* {{App|[[Bash]]|Bash is an sh-compatible shell that incorporates useful features from the Korn shell (ksh) and C shell (csh). It is intended to conform to the IEEE POSIX P1003.2/ISO 9945.2 Shell and Tools standard. It offers functional improvements over sh for both programming and interactive use. In addition, most sh scripts can be run by Bash without modification.|https://www.gnu.org/software/bash/|{{Pkg|bash}}}}
 +
 
 
* {{App|[[Wikipedia:C shell|C shell]]|Command language interpreter usable both as an interactive login shell and a shell script command processor. It includes a command-line editor, programmable word completion, spelling correction, a history mechanism, job control and a C-like syntax.|http://www.tcsh.org|{{Pkg|tcsh}}}}
 
* {{App|[[Wikipedia:C shell|C shell]]|Command language interpreter usable both as an interactive login shell and a shell script command processor. It includes a command-line editor, programmable word completion, spelling correction, a history mechanism, job control and a C-like syntax.|http://www.tcsh.org|{{Pkg|tcsh}}}}
 +
 
* {{App|[[Dash|DASH]]|POSIX-compliant implementation of {{ic|/bin/sh}} that aims to be as small as possible. It does this without sacrificing speed where possible. In fact, it is significantly faster than Bash (the GNU Bourne-Again SHell) for most tasks.|http://gondor.apana.org.au/~herbert/dash/|{{Pkg|dash}}}}
 
* {{App|[[Dash|DASH]]|POSIX-compliant implementation of {{ic|/bin/sh}} that aims to be as small as possible. It does this without sacrificing speed where possible. In fact, it is significantly faster than Bash (the GNU Bourne-Again SHell) for most tasks.|http://gondor.apana.org.au/~herbert/dash/|{{Pkg|dash}}}}
* {{App|[[Fish]]|Smart and user-friendly command line shell for OS X, Linux, and the rest of the family.|http://fishshell.com/|{{Pkg|fish}}}}
+
 
* {{App|[[Korn shell]]|The KornShell language was designed and developed by David G. Korn at AT&T Bell Laboratories. It is an interactive command language that provides access to the UNIX system and to many other systems, on the many different computers and workstations on which it is implemented. The KornShell language is also a complete, powerful, high-level programming language for writing applications, often more easily and quickly than with other high-level languages. This makes it especially suitable for prototyping. There are two other widely used shells, the Bourne shell developed by Steven Bourne at AT&T Bell Laboratories, and the C shell developed by Bill Joy at the University of California. ksh has the best features of both, plus many new features of its own. Thus ksh can do much to enhance your productivity and the quality of your work, both in interacting with the system, and in programming. ksh programs are easier to write, and are more concise and readable than programs written in a lower level language such as C.|http://www.kornshell.com|See [[Ksh#Installation|article]]}}
+
* {{App|[[fish]]|Smart and user-friendly command line shell. Fish performs full-color command line syntax highlighting, as well as highlighting and completion for commands and their arguments, file existence, and history. It supports complete-as-you-type for history and commands. Fish is able to parse the system's man pages in order to determine valid arguments for commands, allowing it to highlight and complete commands. Easy last-command revision can be done using Alt-Up. The fish daemon (fishd) facilitates synchronized history across all instances of fish, as well as universal and persistent environment variables.|http://fishshell.com/|{{Pkg|fish}}}}
* {{App|Oh|Unix shell written in Go. It is similar in spirit but different in detail from other Unix shells. Oh extends the shell's programming language features without sacrificing the shell's interactive features.|https://github.com/michaelmacinnis/oh|{{AUR|oh}}}}
+
 
 +
* {{App|[[Korn shell]]|The KornShell language is a complete, powerful, high-level programming language for writing applications, often more easily and quickly than with other high-level languages. This makes it especially suitable for prototyping. ksh has the best features of the Bourne shell and the C shell, plus many new features of its own. Thus ksh can do much to enhance your productivity and the quality of your work, both in interacting with the system, and in programming. ksh programs are easier to write, and are more concise and readable than programs written in a lower level language such as C.|http://www.kornshell.com|See [[Ksh#Installation|article]]}}
 +
 
 +
* {{App|[[Nash]]|Nash is a system shell, inspired by plan9 rc, that makes it easy to create reliable and safe scripts taking advantages of operating systems namespaces (on linux and plan9) in an idiomatic way.|https://github.com/NeowayLabs/nash|{{AUR|nash-git}}}}
 +
 
 +
* {{App|Oh|Unix shell written in Go. It is similar in spirit but different in detail from other Unix shells. Oh extends the shell's programming language features without sacrificing the shell's interactive features.|https://github.com/michaelmacinnis/oh|{{AUR|oh}}{{Broken package link|{{aur-mirror|oh}}}}}}
 +
 
 +
* {{App|[[Wikipedia: Windows Powershell|Powershell]]|PowerShell is an object-oriented programming language and interactive command line shell, originally written for and exclusive to Windows. Later on, it was open sourced and ported to Mac OS X and Linux.|https://github.com/PowerShell/PowerShell|{{AUR|powershell-git}}}}
 +
 
 
* {{App|[[Wikipedia:rc|rc]]|Command interpreter for Plan 9 that provides similar facilities to UNIX’s Bourne shell, with some small additions and less idiosyncratic syntax.|http://plan9.bell-labs.com/sys/doc/rc.html|{{AUR|9base-git}}}}
 
* {{App|[[Wikipedia:rc|rc]]|Command interpreter for Plan 9 that provides similar facilities to UNIX’s Bourne shell, with some small additions and less idiosyncratic syntax.|http://plan9.bell-labs.com/sys/doc/rc.html|{{AUR|9base-git}}}}
 +
 +
* {{App|xonsh|A retrocompatible shell based on the python interpreter.|http://xon.sh/|{{AUR|xonsh}}}}
 +
 
* {{App|[[Zsh]]|Shell designed for interactive use, although it is also a powerful scripting language. Many of the useful features of Bash, ksh, and tcsh were incorporated into Zsh; many original features were added. The [http://zsh.sourceforge.net/Intro/intro_toc.html introductory document] details some of the unique features of Zsh.|http://www.zsh.org/|{{Pkg|zsh}}}}
 
* {{App|[[Zsh]]|Shell designed for interactive use, although it is also a powerful scripting language. Many of the useful features of Bash, ksh, and tcsh were incorporated into Zsh; many original features were added. The [http://zsh.sourceforge.net/Intro/intro_toc.html introductory document] details some of the unique features of Zsh.|http://www.zsh.org/|{{Pkg|zsh}}}}
 +
 +
== Changing your default shell ==
 +
 +
After installing one the above shells, you can execute that shell inside of your current shell, by just running its executable. If you want to be served that shell when you login however, you will need to change your default shell.
 +
 +
To list all installed shells, run:
 +
$ chsh -l
 +
 +
And to set one as default for your user do:
 +
$ chsh -s ''full-path-to-shell''
 +
 +
where ''full-path-to-shell'' is the full path as given by {{ic|chsh -l}}.
 +
 +
If you now log out and log in again, you will be greeted by the other shell.
  
 
== See also ==
 
== See also ==
Line 19: Line 47:
 
* [http://www.ibm.com/developerworks/linux/library/l-linux-shells/index.html Evolution of shells in Linux] on the IBM developerWorks
 
* [http://www.ibm.com/developerworks/linux/library/l-linux-shells/index.html Evolution of shells in Linux] on the IBM developerWorks
 
* [http://www.goosh.org/ Goosh] is the unofficial Google shell, which implements a shell interface over the commonly used Google search interface.
 
* [http://www.goosh.org/ Goosh] is the unofficial Google shell, which implements a shell interface over the commonly used Google search interface.
 +
* [http://bashrcgenerator.com/ >_ .bashrc PS1 generator] generate your .bashrc/PS1 bash prompt easily with a drag and drop interface.
 +
* [https://terminal.sexy/ terminal.sexy] — Terminal Color Scheme Designer
 +
* [http://hyperpolyglot.org/unix-shells Hyperpolyglot] — Hyperpolyglot entry about shell

Latest revision as of 17:36, 23 November 2016

From Wikipedia:

A Unix shell is a command-line interpreter or shell that provides a traditional user interface for the Unix operating system and for Unix-like systems. Users direct the operation of the computer by entering commands as text for a command line interpreter to execute or by creating text scripts of one or more such commands.

List of shells

  • Bash — Bash is an sh-compatible shell that incorporates useful features from the Korn shell (ksh) and C shell (csh). It is intended to conform to the IEEE POSIX P1003.2/ISO 9945.2 Shell and Tools standard. It offers functional improvements over sh for both programming and interactive use. In addition, most sh scripts can be run by Bash without modification.
https://www.gnu.org/software/bash/ || bash
  • C shell — Command language interpreter usable both as an interactive login shell and a shell script command processor. It includes a command-line editor, programmable word completion, spelling correction, a history mechanism, job control and a C-like syntax.
http://www.tcsh.org || tcsh
  • DASH — POSIX-compliant implementation of /bin/sh that aims to be as small as possible. It does this without sacrificing speed where possible. In fact, it is significantly faster than Bash (the GNU Bourne-Again SHell) for most tasks.
http://gondor.apana.org.au/~herbert/dash/ || dash
  • fish — Smart and user-friendly command line shell. Fish performs full-color command line syntax highlighting, as well as highlighting and completion for commands and their arguments, file existence, and history. It supports complete-as-you-type for history and commands. Fish is able to parse the system's man pages in order to determine valid arguments for commands, allowing it to highlight and complete commands. Easy last-command revision can be done using Alt-Up. The fish daemon (fishd) facilitates synchronized history across all instances of fish, as well as universal and persistent environment variables.
http://fishshell.com/ || fish
  • Korn shell — The KornShell language is a complete, powerful, high-level programming language for writing applications, often more easily and quickly than with other high-level languages. This makes it especially suitable for prototyping. ksh has the best features of the Bourne shell and the C shell, plus many new features of its own. Thus ksh can do much to enhance your productivity and the quality of your work, both in interacting with the system, and in programming. ksh programs are easier to write, and are more concise and readable than programs written in a lower level language such as C.
http://www.kornshell.com || See article
  • Nash — Nash is a system shell, inspired by plan9 rc, that makes it easy to create reliable and safe scripts taking advantages of operating systems namespaces (on linux and plan9) in an idiomatic way.
https://github.com/NeowayLabs/nash || nash-gitAUR
  • Oh — Unix shell written in Go. It is similar in spirit but different in detail from other Unix shells. Oh extends the shell's programming language features without sacrificing the shell's interactive features.
https://github.com/michaelmacinnis/oh || ohAUR[broken link: archived in aur-mirror]
  • Powershell — PowerShell is an object-oriented programming language and interactive command line shell, originally written for and exclusive to Windows. Later on, it was open sourced and ported to Mac OS X and Linux.
https://github.com/PowerShell/PowerShell || powershell-gitAUR
  • rc — Command interpreter for Plan 9 that provides similar facilities to UNIX’s Bourne shell, with some small additions and less idiosyncratic syntax.
http://plan9.bell-labs.com/sys/doc/rc.html || 9base-gitAUR
  • xonsh — A retrocompatible shell based on the python interpreter.
http://xon.sh/ || xonshAUR
  • Zsh — Shell designed for interactive use, although it is also a powerful scripting language. Many of the useful features of Bash, ksh, and tcsh were incorporated into Zsh; many original features were added. The introductory document details some of the unique features of Zsh.
http://www.zsh.org/ || zsh

Changing your default shell

After installing one the above shells, you can execute that shell inside of your current shell, by just running its executable. If you want to be served that shell when you login however, you will need to change your default shell.

To list all installed shells, run:

$ chsh -l

And to set one as default for your user do:

$ chsh -s full-path-to-shell

where full-path-to-shell is the full path as given by chsh -l.

If you now log out and log in again, you will be greeted by the other shell.

See also