LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   What are those double-dash (--) options in man? (https://www.linuxquestions.org/questions/linux-newbie-8/what-are-those-double-dash-options-in-man-189791/)

Utah 06-04-2004 05:57 PM

What are those double-dash (--) options in man?
 
When I look at man pages, most commands seem to have some options listed with a double dash "--" in front of them.

For instance, man rpm lists options:

--quiet Print as little as possible
-v Verbose

Why does the Verbose option use one dash but the Quiet option use two?


Thanks in advance,

Utah

XavierP 06-04-2004 06:10 PM

As far as I can tell, switches that use a letter (like -a) only need a dash, but those that use a word, don't. But I have no idea why - probably something from Unix.

darthtux 06-04-2004 06:19 PM

They are gnu additions to the options to make some of them clearer. The man pages in Slackware make a distinction between industry standard POSIX options and the gnu ones each being under their own section.

XavierP 06-04-2004 06:23 PM

You live and learn :)

Tino27 06-04-2004 10:53 PM

I think additionally that single character options can be strung together on a single '-'.

For example...

tar -xvzf source.tar.gz

instead of (but is functionally the same as)

tar -x -v -z -f source.tar.gz

'--' options are actually single options that are more than one letter.

So...

tar --xvzf source.tar.gz

would actually force the tar program to look for a single option named 'xvzf'.

You can also mix and match, such as

ls -al --co

which will list all (-a) of the contents of the current directory in long (-l) format and apply color (--co) to the display based on the type of file listed on the screen.

Hope that helped.


All times are GMT -5. The time now is 11:27 PM.