About Linux Shell

Posted by: admin  :  Category: Linux Manual

PAGE TAGS: linux shells bash script commands, Linux Software Tutorial

LINUX SHELL

The shell is the interface between the user and the operating system. Via the shell, users and programs send commands to the kernel. Commands sent through a graphical interface or through applications interface directly with the shell without any noticeable events. In many ways, the shell is much like the DOS command interpreter. You can also open a terminal session or a command prompt window to type commands and receive responses back (similar to a DOS prompt in Windows).

Although most Linux distributions now include a graphical interface, and many administration tools have been converted to a graphical format, as an administrator you will find that some tasks are best performed from the command prompt. In addition, while graphical elements vary between distributions, shell commands are more likely to be consistent between distributions.

The shells you’re most likely to encounter come from two different derivations:

Bourne shells

- Bourne shells use syntax and conventions similar to a UNIX shell. sh is the original shell created by Steve Bourne. The bash shell (Bourne-again shell) includes many improvements and is the default shell for new Linux installations.

C-shells

- C-shells use syntax similar to the C programming language. The original C-shell (csh) has given way to more powerful derivations like tcsh, zsh, and ksh.
Like everything else in Linux, the shell is just a component. This means that you can choose the shell you want to use, or have multiple shells installed on your system at the same time. A list of shells on your system is stored in the /etc/shells file. The default shell for a user is stored in the user account database.

Despite their differences, all shells share some common characteristics:
• All shells are interfaces with the kernel, separate and distinct from it.
• Users can customize every shell using the shell’s commands.
• Shells are run both interactively by end users and noninteractively by the system.
• Shells can be run within one another either interactively when a user starts a second shell at the first shell’s command line, or noninteractively by the system when running scripts or programs.
• Shells use configuration files to establish their operating environments.
• All shells pass environment variables to child processes.
In this course, you will learn to use the bash shell and command prompt to execute commands and perform system maintenance tasks. Keep in mind the following tips for working in the shell.
• When entering commands, remember the format: command + switches + options. Unlike MS-DOS commands, switches come immediately following the command, not at the end.
• Use the clear command to clear the screen.
• If you hit the tab key while typing, bash searches for letters that complete what you’ve typed. If you’ve typed enough unique letters, bash completes the string for you.
• To access commands you’ve already entered into the system, use the arrow up or arrow down key. Find the command and hit enter to re-execute it. Alternatively, you can modify the command with new options, paths, or variables to make it a new command.

Leave a Reply