I just mispelled command
git status
with
!git status
Console showed it started cloning last cloned repository into folder status...
My question is, what does this command mean and does it have any usage?
A number following an exclamation point refers to an event. If that event is in the history list, the shell executes it. Otherwise, the shell displays an error message. A negative number following an exclamation point references an event relative to the current event. For example, the command !–
Sends a command to the Unix shell.
In addition to using single quotes for exclamations, in most shells you can also use a backslash \ to escape it.
Exclamation Marks Turn Requests Into Commands When an imperative sentence ends in a period, it's making a polite request or issuing an instruction.
In bash, if you type !
followed by a command name, it will substitute it with the last command in your history starting by that name.
So in your case !git
was substituted with git clone somerepo
so the whole line was translated to git clone somerepo status
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With