fc
Synopsis
Section titled “Synopsis”fc [command_prefix]Description
Section titled “Description”Edits the last shell command – or the most recent one matching a prefix – in $EDITOR, then executes the result. Bash-style fc behaviour. $EDITOR may carry arguments (e.g. “code --wait”); falls back to vi when unset. Multi-line commands keep their newlines, the scratch file is private (mode 600) and always removed, and an empty buffer aborts without executing.
Arguments
Section titled “Arguments”command_prefix |
Search history for the newest command matching this |
Exit Status
Section titled “Exit Status”0 |
The edited command was queued for execution |
1 |
History lookup found nothing, or the buffer was left empty |
Example
Section titled “Example”fcfc gitClassification: bypasses-shadow(rm), self-limiting(cat)