Meet the terminal and shell

Lesson 2 of 30 · Working with Linux

A graphical interface uses windows, menus, and other visual controls. A command-line interface accepts text. Both can work with files; commands are particularly useful when we need to describe a repeatable operation.

A terminal emulator displays text and passes keystrokes to a program. The shell reads a command, interprets it, and performs a built-in action or starts another program. When the command finishes, the shell normally shows a prompt and waits again:

you → terminal → Bash → command
                   ← output

This interactive cycle of reading input, evaluating it, printing results, and waiting again is sometimes called a REPL (read–evaluate–print loop). Not every command prints a result.

For example, this is a transcript, not three commands:

$ echo 'Ready to explore'
Ready to explore

The $ represents a prompt: do not type it. Type the text after it and press Enter. echo displays the words; the next line is output. Your actual prompt may contain a username or location and look different. Some commands print nothing when successful. whoami prints the effective user name, which depends on the session.

If a command reports an error, read the message and check spelling and location before retrying. An error does not guarantee that a command made no changes. Ctrl+C requests interruption of a foreground command in many terminal programs; it does not undo work already done.