Chapter 7. Conquering the bash Shell

The real power of Linux lies in the shell. So, if you aspire to master Linux, you must conquer the shell. Once you’ve done so, you’ll have the ability to direct your system to do almost anything. This chapter describes the powerful bash shell. The chapter also briefly explains shell variables, shell scripts, and shell aliases, preparing you for an in-depth, continuing study of Linux and its shell.

Issuing Shell Commands

The component of Linux that interprets and executes commands is called the shell. Usually, you’ll access the shell via a terminal window, as explained in Chapter 5 and Chapter 6. However, the section “Using Virtual Consoles” later in this chapter explains how to use a virtual console. Linux supports a variety of different shells, but the most popular is the bash shell. The Linux bash shell presents the user with a Command Line Interface (CLI). CLIs are familiar to Windows users who have worked in the MS-DOS window, and indeed the Windows MS-DOS Prompt window is a kind of command-line shell. The Linux bash shell works much like the MS-DOS Prompt window; you type text commands and the system responds by displaying text replies. As your first Linux command, type w and press Enter. Your contents of the terminal window should look something like this:

 [bill@home bill]$ w
11:12am  up 6 min,  1 user,  load average: 0.00, 0.08, 0.05
USER     TTY      FROM      LOGIN@   IDLE   JCPU   PCPU  WHAT
bill     tty1              11:11am  0.00s  0.20s  0.11s  -bash

The w command ...

Get Learning Red Hat Linux, Second Edition 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.