What does command line arguments mean in pstree -a option












1















When read the manual of pstree



 -a     Show command line arguments.  If the command line of a process is swapped  out,  that  process  is
shown in parentheses. -a implicitly disables compaction for processes but not threads.


I am very confused about 'command line arguments'



Compare the output



me@alpha:~$ pstree |head -5
systemd-+-ModemManager---2*[{ModemManager}]
|-NetworkManager-+-dhclient
| `-2*[{NetworkManager}]
|-accounts-daemon---2*[{accounts-daemon}]
|-acpid
me@alpha:~$ pstree -a | head -5
systemd splash
|-ModemManager --filter-policy=strict
| `-2*[{ModemManager}]
|-NetworkManager --no-daemon
| |-dhclient -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf...


Command lines are composed of function, options and arguments



Say -a show command line arguments, implies that others just show funtions and options, but that is not the case.



What does the command line arguments mean here?










share|improve this question



























    1















    When read the manual of pstree



     -a     Show command line arguments.  If the command line of a process is swapped  out,  that  process  is
    shown in parentheses. -a implicitly disables compaction for processes but not threads.


    I am very confused about 'command line arguments'



    Compare the output



    me@alpha:~$ pstree |head -5
    systemd-+-ModemManager---2*[{ModemManager}]
    |-NetworkManager-+-dhclient
    | `-2*[{NetworkManager}]
    |-accounts-daemon---2*[{accounts-daemon}]
    |-acpid
    me@alpha:~$ pstree -a | head -5
    systemd splash
    |-ModemManager --filter-policy=strict
    | `-2*[{ModemManager}]
    |-NetworkManager --no-daemon
    | |-dhclient -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf...


    Command lines are composed of function, options and arguments



    Say -a show command line arguments, implies that others just show funtions and options, but that is not the case.



    What does the command line arguments mean here?










    share|improve this question

























      1












      1








      1








      When read the manual of pstree



       -a     Show command line arguments.  If the command line of a process is swapped  out,  that  process  is
      shown in parentheses. -a implicitly disables compaction for processes but not threads.


      I am very confused about 'command line arguments'



      Compare the output



      me@alpha:~$ pstree |head -5
      systemd-+-ModemManager---2*[{ModemManager}]
      |-NetworkManager-+-dhclient
      | `-2*[{NetworkManager}]
      |-accounts-daemon---2*[{accounts-daemon}]
      |-acpid
      me@alpha:~$ pstree -a | head -5
      systemd splash
      |-ModemManager --filter-policy=strict
      | `-2*[{ModemManager}]
      |-NetworkManager --no-daemon
      | |-dhclient -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf...


      Command lines are composed of function, options and arguments



      Say -a show command line arguments, implies that others just show funtions and options, but that is not the case.



      What does the command line arguments mean here?










      share|improve this question














      When read the manual of pstree



       -a     Show command line arguments.  If the command line of a process is swapped  out,  that  process  is
      shown in parentheses. -a implicitly disables compaction for processes but not threads.


      I am very confused about 'command line arguments'



      Compare the output



      me@alpha:~$ pstree |head -5
      systemd-+-ModemManager---2*[{ModemManager}]
      |-NetworkManager-+-dhclient
      | `-2*[{NetworkManager}]
      |-accounts-daemon---2*[{accounts-daemon}]
      |-acpid
      me@alpha:~$ pstree -a | head -5
      systemd splash
      |-ModemManager --filter-policy=strict
      | `-2*[{ModemManager}]
      |-NetworkManager --no-daemon
      | |-dhclient -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf...


      Command lines are composed of function, options and arguments



      Say -a show command line arguments, implies that others just show funtions and options, but that is not the case.



      What does the command line arguments mean here?







      bash






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 22 at 4:28









      AliceAlice

      415110




      415110






















          2 Answers
          2






          active

          oldest

          votes


















          1














          Command-line arguments, in general, refers to all arguments after the name of the program being run. For example, in your command pstree | head -5, there is one argument to head which is -5.



          In the pstree output, the tree consists of a root of either a pid (process ID) or init, and then the tree of children threads. For example, in your output, NetworkManager is a parent process that is running one dhclient and 2 NetworkManager threads.



          Adding the -a flag also prints the arguments that were used when each process or thread was started. For example, in your output, we can see that NetworkManager was started with one argument --no-daemon, and likewise dhclient was started with several arguments.



          That is all the man page means by "show command line arguments".






          share|improve this answer































            1














            The arguments are everything that isn't the command name itself. For example, in



            dhclient -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf


            the arguments are all of



            -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf


            These are the values at positions 1 and onwards in the C argv array given to the program when it starts, or in sys.argv[1..] in Python.



            What the pstree manual is implying is that without -a it only lists the name of each program and not any of the other pieces given on the command line. That is what your two examples show: just ModemManager is listed in the first version without -a, but ModemManager --filter-policy=strict in the -a version. It doesn't care whether the "arguments" started with - or what they represented.





            Sometimes programs distinguish "options" and "flags" and "arguments" and even "commands" in their documentation, but to the system they are all just arguments. The program gets given all of them together and gets to decide itself what to do with them, and which fit into each category. It can be useful to help a person think about what they're doing, but it's purely informative and not enforced. Since pstree has to show every program, it can't know how they all think about their command lines and has to be very generic.



            In essence the structure of a command line is



            command-name argument-1 argument-2 argument-3...


            and those arguments could be -x or a sub-command or a path name, and they're all the same until command-name sees them and decides what to do. pstree sees them all in a raw form and just reports them to you when you ask for them.






            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',
              autoActivateHeartbeat: false,
              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%2f1111838%2fwhat-does-command-line-arguments-mean-in-pstree-a-option%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









              1














              Command-line arguments, in general, refers to all arguments after the name of the program being run. For example, in your command pstree | head -5, there is one argument to head which is -5.



              In the pstree output, the tree consists of a root of either a pid (process ID) or init, and then the tree of children threads. For example, in your output, NetworkManager is a parent process that is running one dhclient and 2 NetworkManager threads.



              Adding the -a flag also prints the arguments that were used when each process or thread was started. For example, in your output, we can see that NetworkManager was started with one argument --no-daemon, and likewise dhclient was started with several arguments.



              That is all the man page means by "show command line arguments".






              share|improve this answer




























                1














                Command-line arguments, in general, refers to all arguments after the name of the program being run. For example, in your command pstree | head -5, there is one argument to head which is -5.



                In the pstree output, the tree consists of a root of either a pid (process ID) or init, and then the tree of children threads. For example, in your output, NetworkManager is a parent process that is running one dhclient and 2 NetworkManager threads.



                Adding the -a flag also prints the arguments that were used when each process or thread was started. For example, in your output, we can see that NetworkManager was started with one argument --no-daemon, and likewise dhclient was started with several arguments.



                That is all the man page means by "show command line arguments".






                share|improve this answer


























                  1












                  1








                  1







                  Command-line arguments, in general, refers to all arguments after the name of the program being run. For example, in your command pstree | head -5, there is one argument to head which is -5.



                  In the pstree output, the tree consists of a root of either a pid (process ID) or init, and then the tree of children threads. For example, in your output, NetworkManager is a parent process that is running one dhclient and 2 NetworkManager threads.



                  Adding the -a flag also prints the arguments that were used when each process or thread was started. For example, in your output, we can see that NetworkManager was started with one argument --no-daemon, and likewise dhclient was started with several arguments.



                  That is all the man page means by "show command line arguments".






                  share|improve this answer













                  Command-line arguments, in general, refers to all arguments after the name of the program being run. For example, in your command pstree | head -5, there is one argument to head which is -5.



                  In the pstree output, the tree consists of a root of either a pid (process ID) or init, and then the tree of children threads. For example, in your output, NetworkManager is a parent process that is running one dhclient and 2 NetworkManager threads.



                  Adding the -a flag also prints the arguments that were used when each process or thread was started. For example, in your output, we can see that NetworkManager was started with one argument --no-daemon, and likewise dhclient was started with several arguments.



                  That is all the man page means by "show command line arguments".







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 22 at 4:46









                  rlhelinskirlhelinski

                  415




                  415

























                      1














                      The arguments are everything that isn't the command name itself. For example, in



                      dhclient -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf


                      the arguments are all of



                      -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf


                      These are the values at positions 1 and onwards in the C argv array given to the program when it starts, or in sys.argv[1..] in Python.



                      What the pstree manual is implying is that without -a it only lists the name of each program and not any of the other pieces given on the command line. That is what your two examples show: just ModemManager is listed in the first version without -a, but ModemManager --filter-policy=strict in the -a version. It doesn't care whether the "arguments" started with - or what they represented.





                      Sometimes programs distinguish "options" and "flags" and "arguments" and even "commands" in their documentation, but to the system they are all just arguments. The program gets given all of them together and gets to decide itself what to do with them, and which fit into each category. It can be useful to help a person think about what they're doing, but it's purely informative and not enforced. Since pstree has to show every program, it can't know how they all think about their command lines and has to be very generic.



                      In essence the structure of a command line is



                      command-name argument-1 argument-2 argument-3...


                      and those arguments could be -x or a sub-command or a path name, and they're all the same until command-name sees them and decides what to do. pstree sees them all in a raw form and just reports them to you when you ask for them.






                      share|improve this answer




























                        1














                        The arguments are everything that isn't the command name itself. For example, in



                        dhclient -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf


                        the arguments are all of



                        -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf


                        These are the values at positions 1 and onwards in the C argv array given to the program when it starts, or in sys.argv[1..] in Python.



                        What the pstree manual is implying is that without -a it only lists the name of each program and not any of the other pieces given on the command line. That is what your two examples show: just ModemManager is listed in the first version without -a, but ModemManager --filter-policy=strict in the -a version. It doesn't care whether the "arguments" started with - or what they represented.





                        Sometimes programs distinguish "options" and "flags" and "arguments" and even "commands" in their documentation, but to the system they are all just arguments. The program gets given all of them together and gets to decide itself what to do with them, and which fit into each category. It can be useful to help a person think about what they're doing, but it's purely informative and not enforced. Since pstree has to show every program, it can't know how they all think about their command lines and has to be very generic.



                        In essence the structure of a command line is



                        command-name argument-1 argument-2 argument-3...


                        and those arguments could be -x or a sub-command or a path name, and they're all the same until command-name sees them and decides what to do. pstree sees them all in a raw form and just reports them to you when you ask for them.






                        share|improve this answer


























                          1












                          1








                          1







                          The arguments are everything that isn't the command name itself. For example, in



                          dhclient -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf


                          the arguments are all of



                          -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf


                          These are the values at positions 1 and onwards in the C argv array given to the program when it starts, or in sys.argv[1..] in Python.



                          What the pstree manual is implying is that without -a it only lists the name of each program and not any of the other pieces given on the command line. That is what your two examples show: just ModemManager is listed in the first version without -a, but ModemManager --filter-policy=strict in the -a version. It doesn't care whether the "arguments" started with - or what they represented.





                          Sometimes programs distinguish "options" and "flags" and "arguments" and even "commands" in their documentation, but to the system they are all just arguments. The program gets given all of them together and gets to decide itself what to do with them, and which fit into each category. It can be useful to help a person think about what they're doing, but it's purely informative and not enforced. Since pstree has to show every program, it can't know how they all think about their command lines and has to be very generic.



                          In essence the structure of a command line is



                          command-name argument-1 argument-2 argument-3...


                          and those arguments could be -x or a sub-command or a path name, and they're all the same until command-name sees them and decides what to do. pstree sees them all in a raw form and just reports them to you when you ask for them.






                          share|improve this answer













                          The arguments are everything that isn't the command name itself. For example, in



                          dhclient -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf


                          the arguments are all of



                          -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf


                          These are the values at positions 1 and onwards in the C argv array given to the program when it starts, or in sys.argv[1..] in Python.



                          What the pstree manual is implying is that without -a it only lists the name of each program and not any of the other pieces given on the command line. That is what your two examples show: just ModemManager is listed in the first version without -a, but ModemManager --filter-policy=strict in the -a version. It doesn't care whether the "arguments" started with - or what they represented.





                          Sometimes programs distinguish "options" and "flags" and "arguments" and even "commands" in their documentation, but to the system they are all just arguments. The program gets given all of them together and gets to decide itself what to do with them, and which fit into each category. It can be useful to help a person think about what they're doing, but it's purely informative and not enforced. Since pstree has to show every program, it can't know how they all think about their command lines and has to be very generic.



                          In essence the structure of a command line is



                          command-name argument-1 argument-2 argument-3...


                          and those arguments could be -x or a sub-command or a path name, and they're all the same until command-name sees them and decides what to do. pstree sees them all in a raw form and just reports them to you when you ask for them.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Jan 22 at 4:46









                          Michael HomerMichael Homer

                          1575




                          1575






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Ask Ubuntu!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1111838%2fwhat-does-command-line-arguments-mean-in-pstree-a-option%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

                              Human spaceflight

                              Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

                              張江高科駅