hist

Official Description

Defines or displays aliases.

Syntax

hist [-E editor] [-lnr] [command range]

Options

-l lists 16 commands.

-n does not show command numbers.

-r Reverses display order.

Oddities

Command editing is typically done by emacs or vi.

Example

$ ls -l buzz3
-rwxrwxr--   1 obrien   obrien        116 Nov 26 14:07 buzz3
$
$ hist -s zz3=zz4            # Make a change and re-execute
ls -l buzz4
-rwxrwxr--   1 obrien   obrien        165 Nov 26 14:08 buzz4
$
$ hist –l                     # Last 16 commands
1045    ls | grep buzz
1046    ls | grep 17
1047    grep 17 buzz
1048    grep -v 17 buzz
1049    hash
1050    hash ls
1051    hash
1052    hash cat
1053    hash
1054    hash -r
1055    hash
1056    man hist
1057    ls -l buzz3
1058    ls -l buzz4
1059    ls -l buzz4
1060
				

Get Korn Shell Programming by Example 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.