Friday, August 17, 2007

Unix - `history`

Unix command.

`history` - process command history list

csh history [ -hr ] [ n ]

The command history list references commands by number. The first number in the list is selected arbitrarily. The rela- tionship of a number to its command will not change except when the user logs in and no other process is accessing the list, at which time the system may reset the numbering to start the oldest retained command at another number (usually 1). When the number reaches the value in HISTSIZE or 128 (whichever is greater), the shell may wrap the numbers, starting the next command with a lower number (usually 1). However, despite this optional wrapping of numbers, fc will maintain the time-ordering sequence of the commands. For example, if four commands in sequence are given the numbers 32766, 32767, 1 (wrapped), and 2 as they are executed, com- mand 32767 is considered the command previous to 1, even though its number is higher.


csh
Display the history list; if n is given, display only the n most recent events.
-r Reverse the order of printout to be most recent first rather than oldest first.
-h Display the history list without leading numbers. This is used to produce files suitable for sourcing using the -h option to the csh built-in command, source(1).

No comments: