The fc Command

The fc command allows you to list, or edit and re-execute history file commands. It is the simplest interface to the command history file provided with the Korn shell. The fc command also allows you to manipulate the history file using your own choice of editors.

Displaying the Command History File

The command history file can be displayed using the fc command in a number of ways: with or without command numbers, using a range of line numbers, in reverse order, and more. The format for displaying the command history file with the fc –l command is:

						fc —l[nr] [range]
					

where the –n option causes the command numbers to not be displayed, and the –r option specifies reverse order (latest commands first). The range of commands to list ...

Get Korn Shell: Unix and Linux Programming Manual, Third Edition, The 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.