0

I was wondering:

  • What is the difference between -q and --quiet?
  • And in which case do I use -q and --quiet?

Thank you!

terdon
  • 242,166
  • 3
    Please [edit] your question and give us some context. There are hundreds, probably thousands, of tools that have both a -q and a --quiet option. What they mean depends on the specific tool you are interested in. For some they will be the same, for others they might be completely different. – terdon Dec 18 '22 at 17:53

3 Answers3

1

Many Linux/Unix console applications have long and short options. Check man application - if it says it's the same, it's the same. It doesn't matter what you use -- the long option is just verbose and easier to read.

  • or else use application -h or application --help to check if option are identical. – Archemar Dec 18 '22 at 19:16
  • @Archemar Depending on the application you might need to use -? or —options. There are a few where if you don’t give any options you’ll get the usage screen. YMMV – doneal24 Dec 18 '22 at 20:05
0

It's more of a convention than anything else. A lot of tools have both the fully written option and the shorthand option.

This is mostly a matter of preference. Some people prefer readability over brevity and the other way around.

As terdon mentions it highly depends on the tool in question and it's no certainty that -q is the same as --quiet, always check the manpage.

Also there is no real consistency, more mature and larger projects tend to have a more complete and well thought out way of doing things. And even this is highly debatable as some very well known and often used tools can have a weird way of defining parameters.

Lucas
  • 119
proxx
  • 87
0

It depends entirely on the application. If the application's docs say they are equivalent, they are. If not, -q and --quiet could both be valid but completely unrelated.

Command line options are purely a convention. Often, you can sort of figure out a CLI programs heritage, or even allegiances by their arguments. If your program says -q and --quiet are equivalent, its developers were likely steeped in GNU, though they may not have even realized it.

Here's a doc from GNU, of note:

Please define long-named options that are equivalent to the single-letter Unix-style options. We hope to make GNU more user friendly this way.

https://www.gnu.org/prep/standards/html_node/Command_002dLine-Interfaces.html

Lots of older Unix programs don't do this. Plenty of newer ones don't either.

Look at nginx, one of the most popular web servers in the world. nginx -h, totally valid, nginx --help, big old error.

I remember seeing a post many years ago, I believe by some mplayer developers, basically saying that following the -q --quiet convention amounted to tyranny, and they weren't playing.