Quick Tip
Tame Long Commands with `fc`
Challenge: You’ve just typed a very long, complex command, but it’s not quite right, or you want to repeat it with a slight modification. Re-typing it is tedious and error-prone.
The Solution: Use the `fc` command to edit and re-execute previous commands.
fc -e nano
Why it works: `fc` stands for “fix command.” When run with `-e`, it opens the specified editor (here, `nano`) with the *previous* command loaded. You can edit it to your heart’s content and then save and exit, which will execute the modified command.
Pro-Tip: To edit a specific command, you can use `fc N`, where N is the command number from your history (e.g., `fc 123`). You can also use `fc -2 3` to edit commands from number 2 up to number 3.
Linux Tips & Tricks | © ngelinux.com | 4/30/2026
