What is sudo bang bang? [closed]

核能气质少年 提交于 2019-12-03 01:28:32

问题


Besides from this comic, I have seen some people write sudo !!.

What is sudo bang bang?


回答1:


The bang bang (!!) command is a shortcut to repeat the previous command you entered in your terminal. This command is very useful when you forget that you need admin rights to make a certain action, and lets you repeat it with super-user rights just by typing

sudo !!

instead of typing arrow-up, scrolling to the beginning of the line, adding sudo and hitting enter (imagine scrolling through those loooong apt-get commands). So many seconds gained! Yay!

There are many other bang-commands such as !x, !?x, !!:p and !!*. This blog post lists them and explains what they are for.



来源:https://stackoverflow.com/questions/15137461/what-is-sudo-bang-bang

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