In bash what does ! (exclamation mark) before command means?

倾然丶 夕夏残阳落幕 提交于 2019-12-21 04:16:29

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/48748030/in-bash-what-does-exclamation-mark-before-command-means

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!