Using the Shell

This book introduced you to the shell in Chapter 4. However, many important details were omitted in that chapter, which was aimed at helping you to get your Linux system up and running as quickly as possible. This section revisits the shell, providing you with information that will help you use the shell efficiently and effectively.

Typing Shell Commands

When typing shell commands, you have access to a mini-editor that resembles the DOSKEYS editor of MS-DOS. Table 13-2 summarizes some useful keystroke commands interpreted by the shell. The keystroke commands let you access a list of recently executed commands, called the history list. To re-execute a command, you can press the Up key several times until you locate the command and then merely press Enter to execute the command.

Table 13-2. Useful Editing Keystrokes

Keystroke(s)

Function

Up

Move back one command in the history list.

Down

Move forward one command in the history list.

Left

Move back one character.

Right

Move forward one character.

Esc f

Move forward one word.

Esc b

Move back one word.

Ctrl-A

Move to beginning of line.

Ctrl-E

Move to end of line.

Ctrl-D

Delete current character.

Backspace

Delete previous character.

Esc d

Delete current word.

Ctrl-U

Delete from beginning of line.

Esc k

Delete to end of line.

Ctrl-Y

Retrieve last item deleted.

Esc .

Insert last word of previous command.

Ctrl-L

Clear the screen, placing the current line at the top of the screen. ...

Get Learning Debian GNU/Linux 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.