Skip to Content
Linux in a Nutshell, 6th Edition
book

Linux in a Nutshell, 6th Edition

by Ellen Siever, Stephen Figgins, Robert Love, Arnold Robbins
September 2009
Beginner
942 pages
85h 34m
English
O'Reilly Media, Inc.
Content preview from Linux in a Nutshell, 6th Edition

The fc Command

fc stands for either “find command” or “fix command,” since it does both jobs. Use fc -l to list history commands and fc -e to edit them. See the fc entry in the section Built-in Commands in Built-in Commands for more information.

Examples

$ history             List the last 16 commands
$ fc -l 20 30         List commands 20 through 30
$ fc −l −5            List the last five commands
$ fc -l cat           List all commands since the last command beginning with cat
$ fc -l 50            List all commands since command 50
$ fc -ln 5 > doit     Save command 5 to file doit
$ fc -e vi 5 20       Edit commands 5 through 20 using vi
$ fc -e emacs         Edit previous command using emacs

Interactive line editing is easier to use than fc, since you can move up and down in the saved command history using your favorite editor commands (as long as your favorite editor is either vi or Emacs!). You can also use the Up and Down arrow keys to traverse the command history and the right and left arrow keys to move around in the command line.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Unix in a Nutshell, 4th Edition

Unix in a Nutshell, 4th Edition

Arnold Robbins
Linux Under the Hood

Linux Under the Hood

Sander van Vugt
Linux Kernel in a Nutshell

Linux Kernel in a Nutshell

Greg Kroah-Hartman

Publisher Resources

ISBN: 9780596806088Errata Page