
histexpand:tldr:05185
histexpand: Run the command `n` lines back in the history.
$ !-${n}
try on your machine
The command "!-${n}" is a command used in a Unix/Linux command line environment. Here is an explanation of each component:
- "!" (exclamation mark) is a special character that refers to the most recent command that was executed in the command history.
- "-" (minus sign) is a command line argument or option used to refer to a specific position in the command history.
- "${n}" is a variable expression that represents a specific position in the command history.
When you use "!-${n}" in the command line, it will refer to the command executed "n" positions ago in the command history. For example, if you execute "!-1", it will execute the previous command that was entered. Similarly, using "!-2" will execute the command before the previous one, and so on.
By replacing "n" with a specific number, you can refer to any command that was executed earlier in the command history, allowing you to perform operations or modifications on a specific command without having to retype it entirely.
This explanation was created by an AI. In most cases those are correct. But please always be careful and
never run a command you are not sure if it is safe.