What's the difference between “-h” and “--help”? [closed]












0















Sometimes I see -h is a manual for a application, and sometimes I find --help in the manual.



What is the difference between them? Is there any history/story about this?










share|improve this question















closed as too broad by bertieb, Twisty Impersonator, LotPings, JakeGould, music2myear Dec 24 '18 at 20:31


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
















  • This isn’t a bad question, but there is no generic reason why this exists. Some apps use one convention, others use another. That’s it. No deep rationale or logic.

    – JakeGould
    Dec 24 '18 at 20:10


















0















Sometimes I see -h is a manual for a application, and sometimes I find --help in the manual.



What is the difference between them? Is there any history/story about this?










share|improve this question















closed as too broad by bertieb, Twisty Impersonator, LotPings, JakeGould, music2myear Dec 24 '18 at 20:31


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
















  • This isn’t a bad question, but there is no generic reason why this exists. Some apps use one convention, others use another. That’s it. No deep rationale or logic.

    – JakeGould
    Dec 24 '18 at 20:10
















0












0








0








Sometimes I see -h is a manual for a application, and sometimes I find --help in the manual.



What is the difference between them? Is there any history/story about this?










share|improve this question
















Sometimes I see -h is a manual for a application, and sometimes I find --help in the manual.



What is the difference between them? Is there any history/story about this?







linux macos shell






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 24 '18 at 20:08









JakeGould

31.2k1094137




31.2k1094137










asked Dec 24 '18 at 6:39









user956609user956609

32




32




closed as too broad by bertieb, Twisty Impersonator, LotPings, JakeGould, music2myear Dec 24 '18 at 20:31


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






closed as too broad by bertieb, Twisty Impersonator, LotPings, JakeGould, music2myear Dec 24 '18 at 20:31


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.















  • This isn’t a bad question, but there is no generic reason why this exists. Some apps use one convention, others use another. That’s it. No deep rationale or logic.

    – JakeGould
    Dec 24 '18 at 20:10





















  • This isn’t a bad question, but there is no generic reason why this exists. Some apps use one convention, others use another. That’s it. No deep rationale or logic.

    – JakeGould
    Dec 24 '18 at 20:10



















This isn’t a bad question, but there is no generic reason why this exists. Some apps use one convention, others use another. That’s it. No deep rationale or logic.

– JakeGould
Dec 24 '18 at 20:10







This isn’t a bad question, but there is no generic reason why this exists. Some apps use one convention, others use another. That’s it. No deep rationale or logic.

– JakeGould
Dec 24 '18 at 20:10












4 Answers
4






active

oldest

votes


















2














The standard place for documentation about unix commands is the unix manual (aka "man pages") (sections 1 and 8), accessed via the man command. For instance, to get the documentation for the grep command, you'd use man grep.



Some commands also provide some built-in documentation if run with an option like -h or --help. This isn't nearly as standard, and how and whether this is provided varies a great deal between commands. As for the difference between -h and --help, that's mostly historical. The "standard" for command options in unix has evolved quite a bit over the decades.



When unix was first "born", different commands took options in completely different formats; this early chaos survives in a few commands like tar (which tends to assume its first argument is options whether or not it starts with -) and dd (which sort of treats all its arguments like long options without --).



But it didn't take long for a standard of sorts to appear: options started with a single dash, and consisted of a single letter or other character, and they had to come before any positional (non-option) parameters. This was before many commands included any built-in help, so commands from this era often use -h for something other than help (for instance, grep -h doesn't print filenames where grep would).



More recently, several additions to this "standard" have appeared: long options that start with a double dash (e.g. --help), allowing options to come after or in amongst the positional parameters, and using -- to indicate the end of options (so everything after that is a positional parameter, even if it starts with dash). Some commands use these new option styles, some don't.



Also recently, some commands have included/added built-in help. How this gets invoked depends, basically, on the whim of the command's developer(s), along with whether -h already had some other meaning (as in cases like grep). So some commands take -h for help, some take --help, some both, and some neither.



Ironically, the best way to find out how to get the built-in help for a command (if it exists), is to read its man page. Here's an excerpt from man grep:



 -H      Always print filename headers with output lines.

-h, --no-filename
Never print filename headers (i.e. filenames) with output lines.

--help Print a brief help message.





share|improve this answer































    0














    Typically --help is used, but if -h works too, developers have probably included it to make it quicker to type.



    It's not standard however and very dependent on the command - vim uses both for example, and bash only uses --help.



    As such, if you're using Linux, man command is typically the definitive help guide.



    You might also enjoy reading this answer for more info on command line arguments.






    share|improve this answer































      0














      -h short attribute is intended to save time of user which types a command(s), sometimes very long;



      --help attribute is intended for bash scripts (which should be easy to understand by many users). In this example -h is obvious but sometimes there are a lot of attributes so using -j, -i -g in bash script is correct - bash script will execute correctly, but your colleague from work probably will kill you :)






      share|improve this answer

































        -1














        It really depends on the specific program. There may be no difference between them. --help may provide more verbose text than -h .






        share|improve this answer






























          4 Answers
          4






          active

          oldest

          votes








          4 Answers
          4






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          The standard place for documentation about unix commands is the unix manual (aka "man pages") (sections 1 and 8), accessed via the man command. For instance, to get the documentation for the grep command, you'd use man grep.



          Some commands also provide some built-in documentation if run with an option like -h or --help. This isn't nearly as standard, and how and whether this is provided varies a great deal between commands. As for the difference between -h and --help, that's mostly historical. The "standard" for command options in unix has evolved quite a bit over the decades.



          When unix was first "born", different commands took options in completely different formats; this early chaos survives in a few commands like tar (which tends to assume its first argument is options whether or not it starts with -) and dd (which sort of treats all its arguments like long options without --).



          But it didn't take long for a standard of sorts to appear: options started with a single dash, and consisted of a single letter or other character, and they had to come before any positional (non-option) parameters. This was before many commands included any built-in help, so commands from this era often use -h for something other than help (for instance, grep -h doesn't print filenames where grep would).



          More recently, several additions to this "standard" have appeared: long options that start with a double dash (e.g. --help), allowing options to come after or in amongst the positional parameters, and using -- to indicate the end of options (so everything after that is a positional parameter, even if it starts with dash). Some commands use these new option styles, some don't.



          Also recently, some commands have included/added built-in help. How this gets invoked depends, basically, on the whim of the command's developer(s), along with whether -h already had some other meaning (as in cases like grep). So some commands take -h for help, some take --help, some both, and some neither.



          Ironically, the best way to find out how to get the built-in help for a command (if it exists), is to read its man page. Here's an excerpt from man grep:



           -H      Always print filename headers with output lines.

          -h, --no-filename
          Never print filename headers (i.e. filenames) with output lines.

          --help Print a brief help message.





          share|improve this answer




























            2














            The standard place for documentation about unix commands is the unix manual (aka "man pages") (sections 1 and 8), accessed via the man command. For instance, to get the documentation for the grep command, you'd use man grep.



            Some commands also provide some built-in documentation if run with an option like -h or --help. This isn't nearly as standard, and how and whether this is provided varies a great deal between commands. As for the difference between -h and --help, that's mostly historical. The "standard" for command options in unix has evolved quite a bit over the decades.



            When unix was first "born", different commands took options in completely different formats; this early chaos survives in a few commands like tar (which tends to assume its first argument is options whether or not it starts with -) and dd (which sort of treats all its arguments like long options without --).



            But it didn't take long for a standard of sorts to appear: options started with a single dash, and consisted of a single letter or other character, and they had to come before any positional (non-option) parameters. This was before many commands included any built-in help, so commands from this era often use -h for something other than help (for instance, grep -h doesn't print filenames where grep would).



            More recently, several additions to this "standard" have appeared: long options that start with a double dash (e.g. --help), allowing options to come after or in amongst the positional parameters, and using -- to indicate the end of options (so everything after that is a positional parameter, even if it starts with dash). Some commands use these new option styles, some don't.



            Also recently, some commands have included/added built-in help. How this gets invoked depends, basically, on the whim of the command's developer(s), along with whether -h already had some other meaning (as in cases like grep). So some commands take -h for help, some take --help, some both, and some neither.



            Ironically, the best way to find out how to get the built-in help for a command (if it exists), is to read its man page. Here's an excerpt from man grep:



             -H      Always print filename headers with output lines.

            -h, --no-filename
            Never print filename headers (i.e. filenames) with output lines.

            --help Print a brief help message.





            share|improve this answer


























              2












              2








              2







              The standard place for documentation about unix commands is the unix manual (aka "man pages") (sections 1 and 8), accessed via the man command. For instance, to get the documentation for the grep command, you'd use man grep.



              Some commands also provide some built-in documentation if run with an option like -h or --help. This isn't nearly as standard, and how and whether this is provided varies a great deal between commands. As for the difference between -h and --help, that's mostly historical. The "standard" for command options in unix has evolved quite a bit over the decades.



              When unix was first "born", different commands took options in completely different formats; this early chaos survives in a few commands like tar (which tends to assume its first argument is options whether or not it starts with -) and dd (which sort of treats all its arguments like long options without --).



              But it didn't take long for a standard of sorts to appear: options started with a single dash, and consisted of a single letter or other character, and they had to come before any positional (non-option) parameters. This was before many commands included any built-in help, so commands from this era often use -h for something other than help (for instance, grep -h doesn't print filenames where grep would).



              More recently, several additions to this "standard" have appeared: long options that start with a double dash (e.g. --help), allowing options to come after or in amongst the positional parameters, and using -- to indicate the end of options (so everything after that is a positional parameter, even if it starts with dash). Some commands use these new option styles, some don't.



              Also recently, some commands have included/added built-in help. How this gets invoked depends, basically, on the whim of the command's developer(s), along with whether -h already had some other meaning (as in cases like grep). So some commands take -h for help, some take --help, some both, and some neither.



              Ironically, the best way to find out how to get the built-in help for a command (if it exists), is to read its man page. Here's an excerpt from man grep:



               -H      Always print filename headers with output lines.

              -h, --no-filename
              Never print filename headers (i.e. filenames) with output lines.

              --help Print a brief help message.





              share|improve this answer













              The standard place for documentation about unix commands is the unix manual (aka "man pages") (sections 1 and 8), accessed via the man command. For instance, to get the documentation for the grep command, you'd use man grep.



              Some commands also provide some built-in documentation if run with an option like -h or --help. This isn't nearly as standard, and how and whether this is provided varies a great deal between commands. As for the difference between -h and --help, that's mostly historical. The "standard" for command options in unix has evolved quite a bit over the decades.



              When unix was first "born", different commands took options in completely different formats; this early chaos survives in a few commands like tar (which tends to assume its first argument is options whether or not it starts with -) and dd (which sort of treats all its arguments like long options without --).



              But it didn't take long for a standard of sorts to appear: options started with a single dash, and consisted of a single letter or other character, and they had to come before any positional (non-option) parameters. This was before many commands included any built-in help, so commands from this era often use -h for something other than help (for instance, grep -h doesn't print filenames where grep would).



              More recently, several additions to this "standard" have appeared: long options that start with a double dash (e.g. --help), allowing options to come after or in amongst the positional parameters, and using -- to indicate the end of options (so everything after that is a positional parameter, even if it starts with dash). Some commands use these new option styles, some don't.



              Also recently, some commands have included/added built-in help. How this gets invoked depends, basically, on the whim of the command's developer(s), along with whether -h already had some other meaning (as in cases like grep). So some commands take -h for help, some take --help, some both, and some neither.



              Ironically, the best way to find out how to get the built-in help for a command (if it exists), is to read its man page. Here's an excerpt from man grep:



               -H      Always print filename headers with output lines.

              -h, --no-filename
              Never print filename headers (i.e. filenames) with output lines.

              --help Print a brief help message.






              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Dec 24 '18 at 7:51









              Gordon DavissonGordon Davisson

              25.6k44350




              25.6k44350

























                  0














                  Typically --help is used, but if -h works too, developers have probably included it to make it quicker to type.



                  It's not standard however and very dependent on the command - vim uses both for example, and bash only uses --help.



                  As such, if you're using Linux, man command is typically the definitive help guide.



                  You might also enjoy reading this answer for more info on command line arguments.






                  share|improve this answer




























                    0














                    Typically --help is used, but if -h works too, developers have probably included it to make it quicker to type.



                    It's not standard however and very dependent on the command - vim uses both for example, and bash only uses --help.



                    As such, if you're using Linux, man command is typically the definitive help guide.



                    You might also enjoy reading this answer for more info on command line arguments.






                    share|improve this answer


























                      0












                      0








                      0







                      Typically --help is used, but if -h works too, developers have probably included it to make it quicker to type.



                      It's not standard however and very dependent on the command - vim uses both for example, and bash only uses --help.



                      As such, if you're using Linux, man command is typically the definitive help guide.



                      You might also enjoy reading this answer for more info on command line arguments.






                      share|improve this answer













                      Typically --help is used, but if -h works too, developers have probably included it to make it quicker to type.



                      It's not standard however and very dependent on the command - vim uses both for example, and bash only uses --help.



                      As such, if you're using Linux, man command is typically the definitive help guide.



                      You might also enjoy reading this answer for more info on command line arguments.







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Dec 24 '18 at 6:56









                      Bennett HardwickBennett Hardwick

                      1261




                      1261























                          0














                          -h short attribute is intended to save time of user which types a command(s), sometimes very long;



                          --help attribute is intended for bash scripts (which should be easy to understand by many users). In this example -h is obvious but sometimes there are a lot of attributes so using -j, -i -g in bash script is correct - bash script will execute correctly, but your colleague from work probably will kill you :)






                          share|improve this answer






























                            0














                            -h short attribute is intended to save time of user which types a command(s), sometimes very long;



                            --help attribute is intended for bash scripts (which should be easy to understand by many users). In this example -h is obvious but sometimes there are a lot of attributes so using -j, -i -g in bash script is correct - bash script will execute correctly, but your colleague from work probably will kill you :)






                            share|improve this answer




























                              0












                              0








                              0







                              -h short attribute is intended to save time of user which types a command(s), sometimes very long;



                              --help attribute is intended for bash scripts (which should be easy to understand by many users). In this example -h is obvious but sometimes there are a lot of attributes so using -j, -i -g in bash script is correct - bash script will execute correctly, but your colleague from work probably will kill you :)






                              share|improve this answer















                              -h short attribute is intended to save time of user which types a command(s), sometimes very long;



                              --help attribute is intended for bash scripts (which should be easy to understand by many users). In this example -h is obvious but sometimes there are a lot of attributes so using -j, -i -g in bash script is correct - bash script will execute correctly, but your colleague from work probably will kill you :)







                              share|improve this answer














                              share|improve this answer



                              share|improve this answer








                              edited Dec 24 '18 at 20:09









                              JakeGould

                              31.2k1094137




                              31.2k1094137










                              answered Dec 24 '18 at 9:06









                              user977149user977149

                              1




                              1























                                  -1














                                  It really depends on the specific program. There may be no difference between them. --help may provide more verbose text than -h .






                                  share|improve this answer




























                                    -1














                                    It really depends on the specific program. There may be no difference between them. --help may provide more verbose text than -h .






                                    share|improve this answer


























                                      -1












                                      -1








                                      -1







                                      It really depends on the specific program. There may be no difference between them. --help may provide more verbose text than -h .






                                      share|improve this answer













                                      It really depends on the specific program. There may be no difference between them. --help may provide more verbose text than -h .







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Dec 24 '18 at 6:49









                                      Jamie HanrahanJamie Hanrahan

                                      18.3k34279




                                      18.3k34279















                                          Popular posts from this blog

                                          Plaza Victoria

                                          Brian Clough

                                          Cáceres