SRE Docs

Execute Commands

Log in to a Linux system and run simple commands with the shell.

Objectives

Save time when running commands from a shell prompt with Bash shortcuts.

Basic Command Syntax

Edit the Command Line

When used interactively, bash has a command-line editing feature. Use the text editor commands to move around and modify the currently typed command. Using the arrow keys to move within the current command and step through the command history was introduced earlier in this section. The following table shows further powerful editing commands.

Useful Command-line Editing Shortcuts

ShortcutDescription
Ctrl+AJump to the beginning of the command line.
Ctrl+EJump to the end of the command line.
Ctrl+UClear from the cursor to the beginning of the command line.
Ctrl+KClear from the cursor to the end of the command line.
Ctrl+LeftArrowJump to the beginning of the previous word on the command line.
Ctrl+RightArrowJump to the end of the next word on the command line.
Ctrl+RSearch the history list of commands for a pattern.

On this page