Skip to content

fc

Usage
fc [command_prefix]

Edits the last shell command – or the most recent one matching a prefix – in $EDITOR, then executes the result. Bash-style fc behaviour. Falls back to vi when $EDITOR is unset, and aborts without executing if the buffer is left empty.

command_prefix Search history for the newest command matching this

The edited command’s exit status, or a message when history lookup found nothing.

Terminal window
fc
fc git

Classification: bypasses-shadow(rm), self-limiting(cat)