History Command

Overview

Displays and manipulates the history of commands.

syntax:history [-hTr] [n]
history -S|-L|-M [filename]
hostory -c
description:   The first form prints the history event list. If n is given, only n most recent events are printed or saved. With -h, the history list is printed without leading numbers. If -T is specified, timestamps are printed also in comment form. (This can be used to produce files suitable for loading with 'history -L' ). With -r, the order of printing is most recent first, rather than oldest first.

With -S, th second form saves the history list to filename. if 'savehist' shell variable is set to a number, at most that many lines are saved.

With -L, the shell appends filename, which is presumably a history list saved by the -S option or the 'savehist' mechanism, to the history list. -M is like -L, but the contents of filename are merged into the history list and sorted by timestamp. In either case, 'histfile' is used if filename is not given and /.history is used if histfile is unset.

If histlis is set, the first and second forms print and save the literal (unexpanded) form of the history list.

The last form clears the history list.
arguments: n n represent a number of history entries that are to be saved or printed
filename Name of the file there to save/load from history list.
options: -h Prints history list without leading number
-T Prints timestamps in comment form
-r Reverses the order of history entries
-S Saves history list to a file
-L Loads external history list from a file
-M Merges external history list file with existing history list. The resulting list is sorted in timestamp order.
-c Clears the history list

Error Conditions

No Error Conditions defined

Return Codes

0Success
any otherError

Where to go next?

Copyright © 1999 Design & Test Center