reosoftproductions.com
RODNEY AND ARLYN'S WEB SITE

Linux Shells

Linux Linux Shells

Linux Shells

A shell is a command-line interpreter or shell that provides a traditional Unix-like command line user interface. 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. Users typically interact with a shell using a terminal emulator, however, direct operation via serial hardware connections, or networking session, are common for server systems. All Unix shells provide filename wildcarding, piping, here documents, command substitution, variables and control structures for condition-testing and iteration.

The most generic sense of the term shell means any program that users employ to type commands. A shell hides the details of the underlying operating system and manages the technical details of the operating system kernel interface, which is the lowest-level, or "inner-most" component of most operating systems.

In Unix-like operating systems, users typically have many choices of command-line interpreters for interactive sessions. When a user logs in to the system interactively, a shell program is automatically executed for the duration of the session. The type of shell, which may be customized for each user, is typically stored in the user's profile, for example in the local passwd file or in a distributed configuration system such as NIS or LDAP; however, the user may execute any other available shell interactively.

The Unix shell is both an interactive command language as well as a scripting programming language, and is used by the operating system as the facility to control (shell script) the execution of the system.[1] Shells created for other operating systems often provide similar functionality.

On hosts with a windowing system, like OS X, some users may never use the shell directly. On Unix systems, the shell has historically been the implementation language of system startup scripts, including the program that starts a windowing system, configures networking, and many other essential functions. However, some system vendors have replaced the traditional shell-based startup system (init) with different approaches, such as systemd.

Graphical user interfaces for Linux, such as GNOME, KDE, and Xfce are sometimes called visual or graphical shells.

My Current Shell

To identify your current shell, type following command:

echo $SHELL

As an example, the following was returned:

hduser> echo $SHELL
/bin/bash

My Available Shells

Your system may have any number of shells available to use. To determine the shells that are currently installed, use the command:

cat /etc/shells

As an example, the following was returned:

hduser> cat /etc/shells
/bin/sh
/bin/bash
/sbin/nologin
/usr/bin/sh
/usr/bin/bash
/usr/sbin/nologin
/bin/tcsh
/bin/csh

A Variety of Shells

bash

Bash is a Unix shell and command language written for the GNU Project as a free software replacement for the Bourne shell (sh). Bash is a command processor that typically runs in a text window, where the user types commands that cause actions. Bash can also read commands from a file, called a script.

bash v4.3 Reference Manual

To display the version information for bash, use:

bash --version

The following may be displayed:

GNU bash, version 4.2.46(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

csh

The C shell, or csh, is a Unix shell. The C shell is a command processor typically run in a text window, allowing the user to type commands. The C shell can also read commands from a file, called a script. Like all Unix shells, it supports filename wildcarding, piping, here documents, command substitution, variables and control structures for condition-testing and iteration. What differentiated the C shell from others, especially in the 1980s, were its interactive features and overall style. Its new features made it easier and faster to use. The overall style of the language looked more like C and was seen as more readable.

KornShell

KornShell, or ksh, is a UNIX shell. The initial development was based on Bourne shell (sh) source code. KornShell is backward-compatible with the Bourne shell and includes many features of the C shell (csh).

Website
The Korn Shell User and Programming Manual - 3rd Edition

nologin

The nologin shell politely refuses a login. nologin displays a message that an account is not available and exits non-zero. It is intended as a replacement shell field to deny login access to an account.

If the file /etc/nologin.txt exists, nologin displays its contents to the user instead of the default message.

The exit code returned by nologin is always 1.

sh

The Bourne shell, or sh, is a shell, or command-line interpreter, for computer operating systems.

The Bourne shell was the default shell for Unix Version 7. Most Unix-like systems continue to have /bin/sh - which will be the Bourne shell, or a symbolic link or hard link to a compatible shell even when other shells are used by most users.

tcsh

tcsh is a Unix shell based on and compatible with the C shell (csh). It is essentially the C shell with programmable command-line completion, command-line editing, and a few other features. Unlike the other common shells, functions cannot be defined in a tcsh script and the user must use aliases instead, as in csh.

The home page for tcsh can be found at http://www.tcsh.org/Home.