Alter Previous Commands

From Coder Merlin
< Shell
Revision as of 15:42, 18 August 2023 by Julian-thomas (talk | contribs)
Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder

Sometimes it's helpful to quickly recall a previous command, alter it slightly, and then execute the altered command. Let's try it:

john-williams@codermerlin:~$  mkdir test_execution_17

Now, let's repeat the command, but rather than using 17 again, let's alter the command to use 18:

john-williams@codermerlin:~$  ^17^18^

The command replaces the previous commands' 17 with 18 and reruns the command. This is called quick substitution and is an event designator.

See this post for more information