O'Reilly logo

Linux in a Nutshell, 6th Edition by Robert Love, Stephen Figgins, Ellen Siever, Arnold Robbins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

history

Synopsis

history [count]
history [options]

Print commands in the history list or manage the history file. With no options or arguments, display the history list with command numbers. With a count argument, print only that number of the most recent commands.

Options

-a

Append new history lines (those executed since the beginning of the session) to the history file.

-c

Clear the history list (remove all entries).

-d position

Delete the history item at position position.

-n

Read unread history lines from the history file into the history list.

-p argument ...

Perform history substitution on each argument, printing the results to standard output. The results are not saved in the history list. Each argument must be quoted.

-r

Read the history file and replace the history list with its contents.

-s argument ...

Store the arguments in the history list as a single entry.

-w

Write the current history list to the history file, overwriting the file.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required