O'Reilly logo

Linux in a Nutshell, Fourth Edition by Aaron Weber, Stephen Figgins, Ellen Siever

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

fc

Synopsis

                  fc [options] [first] [last]
fc -s [oldpattern
                  =
                  newpattern] [command]

Display or edit commands in the history list. (Use only one of -l or -e.) fc provides capabilities similar to the C shell’s history and ! syntax. first and last are numbers or strings specifying the range of commands to display or edit. If last is omitted, fc applies to a single command (specified by first). If both first and last are omitted, fc edits the previous command or lists the last 16. A negative number is treated as an offset from the current command. The second form of fc takes a history command, replaces old string with new string, and executes the modified command. If no strings are specified, command is reexecuted. If no command is given either, the previous command is reexecuted. command is a number or string like first. See earlier examples under Section 7.5.

Options

-e [editor]

Invoke editor to edit the specified history commands. The default editor is set by the shell variable FCEDIT. If FCEDIT is not set, the value of EDITOR is used, or vi if neither is set.

-l [first last]

List the specified command or range of commands, or list the last 16.

-n

Suppress command numbering from the -l listing.

-r

Reverse the order of the -l listing.

-s oldpattern = newpattern

Edit command(s), replacing all occurrences of the specified old pattern with the new pattern. Then reexecute.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required