Command History

Bash lets you display or modify previous commands. Commands in the history list can be modified using:

  • Line-edit mode

  • The fc and hist commands

Bash also supports a command-history mechanism very similar to that of the C shell. This mechanism uses a history expansion character (! by default) to select a line from the history. Portions of the line are then selected to be included in the current line. Because the interactive line-editing features are considerably superior we do not cover those features here. See the Bash manpage for more information.

Get Linux in a Nutshell, 6th 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.