Difference between revisions of "Other standard shells"
m (Text replacement - "<source lang="bash">" to "<syntaxhighlight lang="bash" >") |
|||
Line 12: | Line 12: | ||
==Find out available binary packages shell list== | ==Find out available binary packages shell list== | ||
To find the list of available shell packages under [[Red Hat Enterprise Linux]] / [[CentOS Linux]] / [[Fedora Linux]], enter: | To find the list of available shell packages under [[Red Hat Enterprise Linux]] / [[CentOS Linux]] / [[Fedora Linux]], enter: | ||
− | < | + | <syntaxhighlight lang="bash" >yum search shell</source> |
To find the list of available shell packages under [[Debian Linux]] / [[Ubuntu Linux]], enter: | To find the list of available shell packages under [[Debian Linux]] / [[Ubuntu Linux]], enter: | ||
− | < | + | <syntaxhighlight lang="bash" >apt-cache search shell</source> |
==Pathnames of valid login shells== | ==Pathnames of valid login shells== | ||
[[/etc/shells]] is a text file which contains the full pathnames of valid login shells. This file is consulted by chsh and available to be queried by other programs such as ftp servers. | [[/etc/shells]] is a text file which contains the full pathnames of valid login shells. This file is consulted by chsh and available to be queried by other programs such as ftp servers. | ||
− | < | + | <syntaxhighlight lang="bash" >cat /etc/shells</source> |
Sample outputs: | Sample outputs: | ||
<pre>/bin/sh | <pre>/bin/sh | ||
Line 29: | Line 29: | ||
===which command=== | ===which command=== | ||
You can also use the [[which command]] to display the full path of (shell) commands: | You can also use the [[which command]] to display the full path of (shell) commands: | ||
− | < | + | <syntaxhighlight lang="bash" >which commandname |
which bash</source> | which bash</source> | ||
Sample outputs: | Sample outputs: | ||
<pre>/bin/bash</pre> | <pre>/bin/bash</pre> | ||
For each of its command line arguments it prints to [[stdout]] (screen) the full path of the executables that would have been executed when this argument had been entered at the shell prompt: | For each of its command line arguments it prints to [[stdout]] (screen) the full path of the executables that would have been executed when this argument had been entered at the shell prompt: | ||
− | < | + | <syntaxhighlight lang="bash" > |
which date | which date | ||
which gcc | which gcc | ||
Line 40: | Line 40: | ||
However, which cannot tell you exactly what the shell will execute in all cases as it is an external command. For more accurate information, use [[type command]] as follows: | However, which cannot tell you exactly what the shell will execute in all cases as it is an external command. For more accurate information, use [[type command]] as follows: | ||
− | < | + | <syntaxhighlight lang="bash" >type -p commandName |
type -p bash | type -p bash | ||
type -p date | type -p date |
Revision as of 22:49, 29 March 2016
← The role of shells in the Linux environment • Home • Hello, World! Tutorial →
In Linux, a lot of work is done using a command line shell. Linux comes preinstalled with Bash. Many other shells are available under Linux:
- tcsh - An enhanced version of csh, the C shell.
- ksh - The real, AT&T version of the Korn shell.
- csh - Shell with C-like syntax, standard login shell on BSD systems.
- zsh - A powerful interactive shell.
- scsh- An open-source Unix shell embedded within Scheme programming language.
Find out available binary packages shell list
To find the list of available shell packages under Red Hat Enterprise Linux / CentOS Linux / Fedora Linux, enter: <syntaxhighlight lang="bash" >yum search shell</source>
To find the list of available shell packages under Debian Linux / Ubuntu Linux, enter: <syntaxhighlight lang="bash" >apt-cache search shell</source>
Pathnames of valid login shells
/etc/shells is a text file which contains the full pathnames of valid login shells. This file is consulted by chsh and available to be queried by other programs such as ftp servers. <syntaxhighlight lang="bash" >cat /etc/shells</source> Sample outputs:
/bin/sh /bin/bash /sbin/nologin /bin/tcsh /bin/csh /bin/zsh /bin/ksh
which command
You can also use the which command to display the full path of (shell) commands: <syntaxhighlight lang="bash" >which commandname which bash</source> Sample outputs:
/bin/bash
For each of its command line arguments it prints to stdout (screen) the full path of the executables that would have been executed when this argument had been entered at the shell prompt: <syntaxhighlight lang="bash" > which date which gcc which vi</source>
However, which cannot tell you exactly what the shell will execute in all cases as it is an external command. For more accurate information, use type command as follows: <syntaxhighlight lang="bash" >type -p commandName type -p bash type -p date type -p gcc type -p echo </source>
← The role of shells in the Linux environment • Home • Hello, World! Tutorial →