Chapter 3. Using the Shell

IN THIS CHAPTER

  • Accessing the shell

  • Using command history and completion

  • Assigning aliases

  • Gaining super user access

  • Writing simple shell scripts

The use of a shell command interpreter (usually just called a shell) dates back to the early days of the first Unix systems. Besides its obvious use of running commands, shells have many built-in features such as environment variables, aliases, and a variety of functions for programming. Although the shell used most often with Linux systems is called the Bourne Again Shell (bash), there are other shells available as well (such as sh, csh, ksh, tcsh, and others).

This chapter offers information that will help you use Linux shells, in general, and the bash shell, in particular.

Terminal Windows and Shell Access

The most common way to access a shell from a Linux graphical interface is using a Terminal window. From a graphical interface, you can often access virtual terminals to get to a shell. With no graphical interface, with a text-based login you are typically dropped directly to a shell after login.

Using Terminal Windows

To open a Terminal window from GNOME (the default Fedora desktop), select Applications System Terminal. This opens a gnome-terminal window, displaying a bash shell prompt. Figure 3-1 shows an example of a gnome-terminal window.

Commands shown in Figure 3-1 illustrate that the current shell is the bash shell (/bin/bash), the current user is the desktop user who launched the window (chris), and the current ...

Get Fedora® Linux® TOOLBOX: 1000+ Commands for Fedora, CentOS, and Red Hat® Power Users now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.