42

I just received a Vagrantfile and post install bash script. The vagrantfile downloads standard Ubuntu from Ubuntu Cloud but I found something in the bash script.

Few lines of script reads as:

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

I tried to search around the internet what -qq in shell script stands for, didn't get any mention of it, so, am asking here if anyone knows what it stands for.

AFAIK > /dev/null means the ongoing process is not printed in the screen, for that it doesn't require the -qq flag. So, I am really curious to know.

64

The -qq is a flag to apt-get to make it less noisy.

-qq No output except for errors

You are correct about the >/dev/null. By redirecting all the STDOUT, the -qq becomes redundant.

| improve this answer | |
  • 1
    The -qq would only be redundant if a "-y" was included instead. – Lloyd Dewolf Aug 7 '15 at 21:10
11

The -qq makes it very quiet instead of only quiet. But from my man page, it also implies -y (--assume-yes, answers "yes" to the questions), and the man warns the use of -qq:

From the man page:

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.

You could ask developer of this script to check it.

| improve this answer | |
7

In this case -qq is an option to apt-get and not bash. If you do man apt-get you will get the documentation for apt-get.

It means "really quiet"

-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.

So, to summarize a call to apt-get will be more verbose than apt-get -q which is more verbose than apt-get -qq.

Generally the first place to look for any help on a command is that command's "man" page. man is a standard Linux command that will display help for the given command. So in your case, man apt-get would give you help for the apt-get command.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy