2025-03-14 21:59:59 -06:00
|
|
|
# fc
|
|
|
|
|
|
|
|
|
|
> Open the most recent command for editing and then run it.
|
2025-12-16 10:20:31 -07:00
|
|
|
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-fc>.
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Open the last command in the default system editor and run it after editing:
|
|
|
|
|
|
|
|
|
|
`fc`
|
|
|
|
|
|
|
|
|
|
- Specify an editor to open with:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`fc -e '{{emacs}}'`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- List recent commands from history:
|
|
|
|
|
|
|
|
|
|
`fc -l`
|
|
|
|
|
|
|
|
|
|
- List recent commands in reverse order:
|
|
|
|
|
|
|
|
|
|
`fc -l -r`
|
|
|
|
|
|
|
|
|
|
- Edit and run a command from history:
|
|
|
|
|
|
|
|
|
|
`fc {{number}}`
|
|
|
|
|
|
|
|
|
|
- Edit commands in a given interval and run them:
|
|
|
|
|
|
|
|
|
|
`fc '{{416}}' '{{420}}'`
|
|
|
|
|
|
|
|
|
|
- Display help:
|
|
|
|
|
|
|
|
|
|
`fc --help`
|