apt-get的-qq参数是什么意思?

我刚刚收到一个Vagrantfile和安装后的bash脚本。 vagrantfile从Ubuntu Cloud下载标准的Ubuntu ,但是我在bash脚本中find了一些东西。

几行脚本的内容如下:

apt-get update -qq > /dev/null apt-get -qq -y install apache2 > /dev/null 

我试图在互联网上search一下shell脚本中的-qq是什么-qq ,没有提到它,所以在这里问是否有人知道它代表什么。

AFAIK > /dev/null意味着正在进行的进程不会被打印在屏幕上,因为它不需要-qq标志。 所以,我很想知道。

-qq是一个apt-get的标志,可以减less噪音。

 -qq No output except for errors 

你对>/dev/null是正确的。 通过redirect所有的STDOUT, -qq变得多余。

-qq使它非常安静,而不是只有安静。 但是从我的手册页中,它也暗示了-y (– --assume-yes ,对问题的回答是“是”),并且该人警告使用-qq

从手册页 :

请注意,安静的级别2意味着-y,如果没有无动作修饰符(如-d,–print-uris或-s),则不应使用-qq,因为APT可能会决定执行一些您并不期望的操作。

你可以要求这个脚本的开发者检查它。

在这种情况下, -qq是apt-get的选项,而不是bash。 如果你做了apt-get,你会得到apt-get的文档。

这意味着“真正安静”

 -q, --quiet Quiet. Produces output suitable for logging, omitting progress indicators. More q's will produce more quiet up to a maximum of two. You can also use -q=# to set the quiet level, overriding the configuration file. Note that quiet level 2 implies -y, you should never use -qq without a no-action modifier such as -d, --print-uris or -s as APT may decided to do something you did not expect. 

因此,总结一下, apt-get的调用将比apt-get -q更详细,这比apt-get -qq更为冗长。

一般来说,寻找任何帮助命令的第一个地方就是该命令的“man”页面。 man是标准的Linux命令,它将显示给定命令的帮助。 所以在你的情况下, man apt-get会给你apt-get命令的帮助。