Navigation

Operators and Keywords

Function List:

C++ API

: history
: history opt1
: h = history ()
: h = history (opt1, …)

If invoked with no arguments, history displays a list of commands that you have executed.

Valid options are:

n
-n

Display only the most recent n lines of history.

-c

Clear the history list.

-q

Don’t number the displayed lines of history. This is useful for cutting and pasting commands using the X Window System.

-r file

Read the file file, appending its contents to the current history list. If the name is omitted, use the default history file (normally ~/.octave_hist).

-w file

Write the current history to the file file. If the name is omitted, use the default history file (normally ~/.octave_hist).

For example, to display the five most recent commands that you have typed without displaying line numbers, use the command history -q 5.

If invoked with a single output argument, the history will be saved to that argument as a cell string and will not be output to screen.

See also: edit_history, run_history.

Package: octave