How do I distinguish between a command, utility, or builtin for getting documentation?











up vote
8
down vote

favorite
2












I'm running Bash scripting, but sometimes I get confused which of these commands I use belong to who. Sometimes man xxx works, sometimes doesn't, so I use --help or info, mostly one of these works to show description of the command. Can anyone tell me how I would know what command belongs to what? Bash builtin, GNU utility, etc.










share|improve this question




























    up vote
    8
    down vote

    favorite
    2












    I'm running Bash scripting, but sometimes I get confused which of these commands I use belong to who. Sometimes man xxx works, sometimes doesn't, so I use --help or info, mostly one of these works to show description of the command. Can anyone tell me how I would know what command belongs to what? Bash builtin, GNU utility, etc.










    share|improve this question


























      up vote
      8
      down vote

      favorite
      2









      up vote
      8
      down vote

      favorite
      2






      2





      I'm running Bash scripting, but sometimes I get confused which of these commands I use belong to who. Sometimes man xxx works, sometimes doesn't, so I use --help or info, mostly one of these works to show description of the command. Can anyone tell me how I would know what command belongs to what? Bash builtin, GNU utility, etc.










      share|improve this question















      I'm running Bash scripting, but sometimes I get confused which of these commands I use belong to who. Sometimes man xxx works, sometimes doesn't, so I use --help or info, mostly one of these works to show description of the command. Can anyone tell me how I would know what command belongs to what? Bash builtin, GNU utility, etc.







      command-line manpage documentation info






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 21 at 5:43









      muru

      134k19282482




      134k19282482










      asked Oct 9 '13 at 20:42









      user198436

      7414




      7414






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          5
          down vote



          accepted










          You can use type to find out:



          $ type echo
          echo is a shell builtin
          $ type sudo
          sudo is /usr/bin/sudo


          For bash builtins, use help, as in help echo.






          share|improve this answer




























            up vote
            2
            down vote













            Some builtin commands are included for efficiency sake and exist as external commands in the first place. For example:





            $ type -a echo
            echo is a shell builtin
            echo is /bin/echo

            $ type -a printf
            printf is a shell builtin
            printf is /usr/bin/printf


            A detailed analysis of builtins and external commands can be found in Unix & Linux.





            As far as getting help for dual builtins/external commands such as echo you have two choices. One method is by using man echo:



            ECHO(1)                               User Commands                               ECHO(1)

            NAME
            echo - display a line of text

            SYNOPSIS
            echo [SHORT-OPTION]... [STRING]...
            echo LONG-OPTION

            DESCRIPTION
            Echo the STRING(s) to standard output.

            -n do not output the trailing newline

            -e enable interpretation of backslash escapes

            -E disable interpretation of backslash escapes (default)

            --help display this help and exit

            --version
            output version information and exit

            If -e is in effect, the following sequences are recognized:

            \ backslash

            a alert (BEL)

            Manual page echo(1) line 1 (press h for help or q to quit)


            And you can type:



            $ help echo
            echo: echo [-neE] [arg ...]
            Write arguments to the standard output.

            Display the ARGs, separated by a single space character and followed by a
            newline, on the standard output.

            Options:
            -n do not append a newline
            -e enable interpretation of the following backslash escapes
            -E explicitly suppress interpretation of backslash escapes

            `echo' interprets the following backslash-escaped characters:
            a alert (bell)
            b backspace
            c suppress further output
            e escape character
            E escape character
            f form feed
            n new line
            r carriage return
            t horizontal tab
            v vertical tab
            \ backslash
            nnn the character whose ASCII code is NNN (octal). NNN can be
            0 to 3 octal digits
            xHH the eight-bit character whose value is HH (hexadecimal). HH
            can be one or two hex digits

            Exit Status:
            Returns success unless a write error occurs.





            share|improve this answer























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "89"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














               

              draft saved


              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f355983%2fhow-do-i-distinguish-between-a-command-utility-or-builtin-for-getting-document%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              5
              down vote



              accepted










              You can use type to find out:



              $ type echo
              echo is a shell builtin
              $ type sudo
              sudo is /usr/bin/sudo


              For bash builtins, use help, as in help echo.






              share|improve this answer

























                up vote
                5
                down vote



                accepted










                You can use type to find out:



                $ type echo
                echo is a shell builtin
                $ type sudo
                sudo is /usr/bin/sudo


                For bash builtins, use help, as in help echo.






                share|improve this answer























                  up vote
                  5
                  down vote



                  accepted







                  up vote
                  5
                  down vote



                  accepted






                  You can use type to find out:



                  $ type echo
                  echo is a shell builtin
                  $ type sudo
                  sudo is /usr/bin/sudo


                  For bash builtins, use help, as in help echo.






                  share|improve this answer












                  You can use type to find out:



                  $ type echo
                  echo is a shell builtin
                  $ type sudo
                  sudo is /usr/bin/sudo


                  For bash builtins, use help, as in help echo.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Oct 9 '13 at 21:58









                  choroba

                  6,56411730




                  6,56411730
























                      up vote
                      2
                      down vote













                      Some builtin commands are included for efficiency sake and exist as external commands in the first place. For example:





                      $ type -a echo
                      echo is a shell builtin
                      echo is /bin/echo

                      $ type -a printf
                      printf is a shell builtin
                      printf is /usr/bin/printf


                      A detailed analysis of builtins and external commands can be found in Unix & Linux.





                      As far as getting help for dual builtins/external commands such as echo you have two choices. One method is by using man echo:



                      ECHO(1)                               User Commands                               ECHO(1)

                      NAME
                      echo - display a line of text

                      SYNOPSIS
                      echo [SHORT-OPTION]... [STRING]...
                      echo LONG-OPTION

                      DESCRIPTION
                      Echo the STRING(s) to standard output.

                      -n do not output the trailing newline

                      -e enable interpretation of backslash escapes

                      -E disable interpretation of backslash escapes (default)

                      --help display this help and exit

                      --version
                      output version information and exit

                      If -e is in effect, the following sequences are recognized:

                      \ backslash

                      a alert (BEL)

                      Manual page echo(1) line 1 (press h for help or q to quit)


                      And you can type:



                      $ help echo
                      echo: echo [-neE] [arg ...]
                      Write arguments to the standard output.

                      Display the ARGs, separated by a single space character and followed by a
                      newline, on the standard output.

                      Options:
                      -n do not append a newline
                      -e enable interpretation of the following backslash escapes
                      -E explicitly suppress interpretation of backslash escapes

                      `echo' interprets the following backslash-escaped characters:
                      a alert (bell)
                      b backspace
                      c suppress further output
                      e escape character
                      E escape character
                      f form feed
                      n new line
                      r carriage return
                      t horizontal tab
                      v vertical tab
                      \ backslash
                      nnn the character whose ASCII code is NNN (octal). NNN can be
                      0 to 3 octal digits
                      xHH the eight-bit character whose value is HH (hexadecimal). HH
                      can be one or two hex digits

                      Exit Status:
                      Returns success unless a write error occurs.





                      share|improve this answer



























                        up vote
                        2
                        down vote













                        Some builtin commands are included for efficiency sake and exist as external commands in the first place. For example:





                        $ type -a echo
                        echo is a shell builtin
                        echo is /bin/echo

                        $ type -a printf
                        printf is a shell builtin
                        printf is /usr/bin/printf


                        A detailed analysis of builtins and external commands can be found in Unix & Linux.





                        As far as getting help for dual builtins/external commands such as echo you have two choices. One method is by using man echo:



                        ECHO(1)                               User Commands                               ECHO(1)

                        NAME
                        echo - display a line of text

                        SYNOPSIS
                        echo [SHORT-OPTION]... [STRING]...
                        echo LONG-OPTION

                        DESCRIPTION
                        Echo the STRING(s) to standard output.

                        -n do not output the trailing newline

                        -e enable interpretation of backslash escapes

                        -E disable interpretation of backslash escapes (default)

                        --help display this help and exit

                        --version
                        output version information and exit

                        If -e is in effect, the following sequences are recognized:

                        \ backslash

                        a alert (BEL)

                        Manual page echo(1) line 1 (press h for help or q to quit)


                        And you can type:



                        $ help echo
                        echo: echo [-neE] [arg ...]
                        Write arguments to the standard output.

                        Display the ARGs, separated by a single space character and followed by a
                        newline, on the standard output.

                        Options:
                        -n do not append a newline
                        -e enable interpretation of the following backslash escapes
                        -E explicitly suppress interpretation of backslash escapes

                        `echo' interprets the following backslash-escaped characters:
                        a alert (bell)
                        b backspace
                        c suppress further output
                        e escape character
                        E escape character
                        f form feed
                        n new line
                        r carriage return
                        t horizontal tab
                        v vertical tab
                        \ backslash
                        nnn the character whose ASCII code is NNN (octal). NNN can be
                        0 to 3 octal digits
                        xHH the eight-bit character whose value is HH (hexadecimal). HH
                        can be one or two hex digits

                        Exit Status:
                        Returns success unless a write error occurs.





                        share|improve this answer

























                          up vote
                          2
                          down vote










                          up vote
                          2
                          down vote









                          Some builtin commands are included for efficiency sake and exist as external commands in the first place. For example:





                          $ type -a echo
                          echo is a shell builtin
                          echo is /bin/echo

                          $ type -a printf
                          printf is a shell builtin
                          printf is /usr/bin/printf


                          A detailed analysis of builtins and external commands can be found in Unix & Linux.





                          As far as getting help for dual builtins/external commands such as echo you have two choices. One method is by using man echo:



                          ECHO(1)                               User Commands                               ECHO(1)

                          NAME
                          echo - display a line of text

                          SYNOPSIS
                          echo [SHORT-OPTION]... [STRING]...
                          echo LONG-OPTION

                          DESCRIPTION
                          Echo the STRING(s) to standard output.

                          -n do not output the trailing newline

                          -e enable interpretation of backslash escapes

                          -E disable interpretation of backslash escapes (default)

                          --help display this help and exit

                          --version
                          output version information and exit

                          If -e is in effect, the following sequences are recognized:

                          \ backslash

                          a alert (BEL)

                          Manual page echo(1) line 1 (press h for help or q to quit)


                          And you can type:



                          $ help echo
                          echo: echo [-neE] [arg ...]
                          Write arguments to the standard output.

                          Display the ARGs, separated by a single space character and followed by a
                          newline, on the standard output.

                          Options:
                          -n do not append a newline
                          -e enable interpretation of the following backslash escapes
                          -E explicitly suppress interpretation of backslash escapes

                          `echo' interprets the following backslash-escaped characters:
                          a alert (bell)
                          b backspace
                          c suppress further output
                          e escape character
                          E escape character
                          f form feed
                          n new line
                          r carriage return
                          t horizontal tab
                          v vertical tab
                          \ backslash
                          nnn the character whose ASCII code is NNN (octal). NNN can be
                          0 to 3 octal digits
                          xHH the eight-bit character whose value is HH (hexadecimal). HH
                          can be one or two hex digits

                          Exit Status:
                          Returns success unless a write error occurs.





                          share|improve this answer














                          Some builtin commands are included for efficiency sake and exist as external commands in the first place. For example:





                          $ type -a echo
                          echo is a shell builtin
                          echo is /bin/echo

                          $ type -a printf
                          printf is a shell builtin
                          printf is /usr/bin/printf


                          A detailed analysis of builtins and external commands can be found in Unix & Linux.





                          As far as getting help for dual builtins/external commands such as echo you have two choices. One method is by using man echo:



                          ECHO(1)                               User Commands                               ECHO(1)

                          NAME
                          echo - display a line of text

                          SYNOPSIS
                          echo [SHORT-OPTION]... [STRING]...
                          echo LONG-OPTION

                          DESCRIPTION
                          Echo the STRING(s) to standard output.

                          -n do not output the trailing newline

                          -e enable interpretation of backslash escapes

                          -E disable interpretation of backslash escapes (default)

                          --help display this help and exit

                          --version
                          output version information and exit

                          If -e is in effect, the following sequences are recognized:

                          \ backslash

                          a alert (BEL)

                          Manual page echo(1) line 1 (press h for help or q to quit)


                          And you can type:



                          $ help echo
                          echo: echo [-neE] [arg ...]
                          Write arguments to the standard output.

                          Display the ARGs, separated by a single space character and followed by a
                          newline, on the standard output.

                          Options:
                          -n do not append a newline
                          -e enable interpretation of the following backslash escapes
                          -E explicitly suppress interpretation of backslash escapes

                          `echo' interprets the following backslash-escaped characters:
                          a alert (bell)
                          b backspace
                          c suppress further output
                          e escape character
                          E escape character
                          f form feed
                          n new line
                          r carriage return
                          t horizontal tab
                          v vertical tab
                          \ backslash
                          nnn the character whose ASCII code is NNN (octal). NNN can be
                          0 to 3 octal digits
                          xHH the eight-bit character whose value is HH (hexadecimal). HH
                          can be one or two hex digits

                          Exit Status:
                          Returns success unless a write error occurs.






                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Mar 19 at 10:27

























                          answered Mar 19 at 1:22









                          WinEunuuchs2Unix

                          39.6k1065147




                          39.6k1065147






























                               

                              draft saved


                              draft discarded



















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f355983%2fhow-do-i-distinguish-between-a-command-utility-or-builtin-for-getting-document%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Mouse cursor on multiple screens with different PPI

                              Agildo Ribeiro

                              Sometime when accessing a menu: “Ubuntu 16.04 has experienced an internal error”