sudo bang bang到底是什么? [英] What exactly is sudo bang bang?
问题描述
sudo bang bang(sudo !!
)的作用是什么,什么时候需要使用它?
What is the purpose of sudo bang bang (sudo !!
) and when might one need to use it?
推荐答案
爆炸(!!
)命令是重复您在终端中输入的上一个命令的快捷方式.当您忘记了需要管理员权限才能执行某项操作时,此命令非常有用,只需键入以下内容即可让您以超级用户权限重复该操作
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 !!
而不是向上箭头键,滚动到该行的开头,添加sudo
并按Enter键(想象通过那些 loooong apt-get
命令滚动).获得了这么多秒! 是的!
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!
还有许多其他爆炸命令,例如!x
,!?x
,!!:p
和!!*
.此博客文章列出了它们并解释了什么他们是为了.
There are many other bang-commands such as !x
, !?x
, !!:p
and !!*
. This blog post lists them and explains what they are for.
这篇关于sudo bang bang到底是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!