find process 0 in ps tree

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I read the following sentence from an instruction




Process ID 0 is usually the scheduler process and is often known as the swapper. No program on disk corresponds to this process, which is part of the kernel and is known as a system process. Process ID 1 is usually the init process and is invoked by the kernel at the end of the bootstrap procedure.




Check the processes:



$ pstree -p $$ 
-+= 00001 root /sbin/launchd
-+= 00264 me /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal -psn_0_53261
-+= 00365 root login -pfl me /bin/bash -c exec -la bash /usr/local/bin/bash
-+= 00366 me -bash
|-+= 06305 me pstree -p 366
| --- 06307 root ps -axwwo user,pid,ppid,pgid,command


Could find process 1 but where is process 0?










share|improve this question

























    up vote
    0
    down vote

    favorite












    I read the following sentence from an instruction




    Process ID 0 is usually the scheduler process and is often known as the swapper. No program on disk corresponds to this process, which is part of the kernel and is known as a system process. Process ID 1 is usually the init process and is invoked by the kernel at the end of the bootstrap procedure.




    Check the processes:



    $ pstree -p $$ 
    -+= 00001 root /sbin/launchd
    -+= 00264 me /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal -psn_0_53261
    -+= 00365 root login -pfl me /bin/bash -c exec -la bash /usr/local/bin/bash
    -+= 00366 me -bash
    |-+= 06305 me pstree -p 366
    | --- 06307 root ps -axwwo user,pid,ppid,pgid,command


    Could find process 1 but where is process 0?










    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I read the following sentence from an instruction




      Process ID 0 is usually the scheduler process and is often known as the swapper. No program on disk corresponds to this process, which is part of the kernel and is known as a system process. Process ID 1 is usually the init process and is invoked by the kernel at the end of the bootstrap procedure.




      Check the processes:



      $ pstree -p $$ 
      -+= 00001 root /sbin/launchd
      -+= 00264 me /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal -psn_0_53261
      -+= 00365 root login -pfl me /bin/bash -c exec -la bash /usr/local/bin/bash
      -+= 00366 me -bash
      |-+= 06305 me pstree -p 366
      | --- 06307 root ps -axwwo user,pid,ppid,pgid,command


      Could find process 1 but where is process 0?










      share|improve this question













      I read the following sentence from an instruction




      Process ID 0 is usually the scheduler process and is often known as the swapper. No program on disk corresponds to this process, which is part of the kernel and is known as a system process. Process ID 1 is usually the init process and is invoked by the kernel at the end of the bootstrap procedure.




      Check the processes:



      $ pstree -p $$ 
      -+= 00001 root /sbin/launchd
      -+= 00264 me /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal -psn_0_53261
      -+= 00365 root login -pfl me /bin/bash -c exec -la bash /usr/local/bin/bash
      -+= 00366 me -bash
      |-+= 06305 me pstree -p 366
      | --- 06307 root ps -axwwo user,pid,ppid,pgid,command


      Could find process 1 but where is process 0?







      osx ps






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked yesterday









      avirate

      445210




      445210




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          BSD ps doesn't show PID 0:



          $ ps -o pid,ppid,comm -p 0,1,$$
          PID PPID COMM
          1 0 /sbin/launchd
          14705 14704 -zsh


          Since pstree uses ps to get process information (as you can see in your output), obviously it can't show PID 0.



          Use top, or Activity Manager, on OSX to see PID 0:



          $ top -l1 -pid 0
          Processes: 480 total, 2 running, 478 sleeping, 2777 threads
          2018/11/15 12:20:36
          Load Avg: 1.99, 2.21, 2.13
          CPU usage: 6.59% user, 18.33% sys, 75.7% idle
          SharedLibs: 207M resident, 50M data, 40M linkedit.
          MemRegions: 135141 total, 7727M resident, 63M private, 2624M shared.
          PhysMem: 16G used (6717M wired), 61M unused.
          VM: 3304G vsize, 1297M framework vsize, 5481932(0) swapins, 6319905(0) swapouts.
          Networks: packets: 2367177/1916M in, 1966560/789M out.
          Disks: 2569936/63G read, 1879985/62G written.

          PID COMMAND %CPU TIME #TH #WQ #PORTS MEM PURG CMPRS PGRP PPID STATE BOOSTS %CPU_ME %CPU_OTHRS UID FAULTS COW MSGSENT MSGRECV SYSBSD SYSMACH CSW PAGEINS IDLEW POWER INSTRS CYCLES USER #MREGS RPRVT VPRVT VSIZE KPRVT KSHRD
          0 kernel_task 0.0 47:24.02 211/8 0 0 71M+ 0B 0B 0 0 running 0[0] 0.00000 0.00000 0 400853+ 0 82636075+ 75828596+ 0 0 295335075+ 0 14150823 0.0 0 0 root N/A N/A N/A N/A N/A N/A





          share|improve this answer




















            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            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: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            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%2funix.stackexchange.com%2fquestions%2f481829%2ffind-process-0-in-ps-tree%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            2
            down vote



            accepted










            BSD ps doesn't show PID 0:



            $ ps -o pid,ppid,comm -p 0,1,$$
            PID PPID COMM
            1 0 /sbin/launchd
            14705 14704 -zsh


            Since pstree uses ps to get process information (as you can see in your output), obviously it can't show PID 0.



            Use top, or Activity Manager, on OSX to see PID 0:



            $ top -l1 -pid 0
            Processes: 480 total, 2 running, 478 sleeping, 2777 threads
            2018/11/15 12:20:36
            Load Avg: 1.99, 2.21, 2.13
            CPU usage: 6.59% user, 18.33% sys, 75.7% idle
            SharedLibs: 207M resident, 50M data, 40M linkedit.
            MemRegions: 135141 total, 7727M resident, 63M private, 2624M shared.
            PhysMem: 16G used (6717M wired), 61M unused.
            VM: 3304G vsize, 1297M framework vsize, 5481932(0) swapins, 6319905(0) swapouts.
            Networks: packets: 2367177/1916M in, 1966560/789M out.
            Disks: 2569936/63G read, 1879985/62G written.

            PID COMMAND %CPU TIME #TH #WQ #PORTS MEM PURG CMPRS PGRP PPID STATE BOOSTS %CPU_ME %CPU_OTHRS UID FAULTS COW MSGSENT MSGRECV SYSBSD SYSMACH CSW PAGEINS IDLEW POWER INSTRS CYCLES USER #MREGS RPRVT VPRVT VSIZE KPRVT KSHRD
            0 kernel_task 0.0 47:24.02 211/8 0 0 71M+ 0B 0B 0 0 running 0[0] 0.00000 0.00000 0 400853+ 0 82636075+ 75828596+ 0 0 295335075+ 0 14150823 0.0 0 0 root N/A N/A N/A N/A N/A N/A





            share|improve this answer
























              up vote
              2
              down vote



              accepted










              BSD ps doesn't show PID 0:



              $ ps -o pid,ppid,comm -p 0,1,$$
              PID PPID COMM
              1 0 /sbin/launchd
              14705 14704 -zsh


              Since pstree uses ps to get process information (as you can see in your output), obviously it can't show PID 0.



              Use top, or Activity Manager, on OSX to see PID 0:



              $ top -l1 -pid 0
              Processes: 480 total, 2 running, 478 sleeping, 2777 threads
              2018/11/15 12:20:36
              Load Avg: 1.99, 2.21, 2.13
              CPU usage: 6.59% user, 18.33% sys, 75.7% idle
              SharedLibs: 207M resident, 50M data, 40M linkedit.
              MemRegions: 135141 total, 7727M resident, 63M private, 2624M shared.
              PhysMem: 16G used (6717M wired), 61M unused.
              VM: 3304G vsize, 1297M framework vsize, 5481932(0) swapins, 6319905(0) swapouts.
              Networks: packets: 2367177/1916M in, 1966560/789M out.
              Disks: 2569936/63G read, 1879985/62G written.

              PID COMMAND %CPU TIME #TH #WQ #PORTS MEM PURG CMPRS PGRP PPID STATE BOOSTS %CPU_ME %CPU_OTHRS UID FAULTS COW MSGSENT MSGRECV SYSBSD SYSMACH CSW PAGEINS IDLEW POWER INSTRS CYCLES USER #MREGS RPRVT VPRVT VSIZE KPRVT KSHRD
              0 kernel_task 0.0 47:24.02 211/8 0 0 71M+ 0B 0B 0 0 running 0[0] 0.00000 0.00000 0 400853+ 0 82636075+ 75828596+ 0 0 295335075+ 0 14150823 0.0 0 0 root N/A N/A N/A N/A N/A N/A





              share|improve this answer






















                up vote
                2
                down vote



                accepted







                up vote
                2
                down vote



                accepted






                BSD ps doesn't show PID 0:



                $ ps -o pid,ppid,comm -p 0,1,$$
                PID PPID COMM
                1 0 /sbin/launchd
                14705 14704 -zsh


                Since pstree uses ps to get process information (as you can see in your output), obviously it can't show PID 0.



                Use top, or Activity Manager, on OSX to see PID 0:



                $ top -l1 -pid 0
                Processes: 480 total, 2 running, 478 sleeping, 2777 threads
                2018/11/15 12:20:36
                Load Avg: 1.99, 2.21, 2.13
                CPU usage: 6.59% user, 18.33% sys, 75.7% idle
                SharedLibs: 207M resident, 50M data, 40M linkedit.
                MemRegions: 135141 total, 7727M resident, 63M private, 2624M shared.
                PhysMem: 16G used (6717M wired), 61M unused.
                VM: 3304G vsize, 1297M framework vsize, 5481932(0) swapins, 6319905(0) swapouts.
                Networks: packets: 2367177/1916M in, 1966560/789M out.
                Disks: 2569936/63G read, 1879985/62G written.

                PID COMMAND %CPU TIME #TH #WQ #PORTS MEM PURG CMPRS PGRP PPID STATE BOOSTS %CPU_ME %CPU_OTHRS UID FAULTS COW MSGSENT MSGRECV SYSBSD SYSMACH CSW PAGEINS IDLEW POWER INSTRS CYCLES USER #MREGS RPRVT VPRVT VSIZE KPRVT KSHRD
                0 kernel_task 0.0 47:24.02 211/8 0 0 71M+ 0B 0B 0 0 running 0[0] 0.00000 0.00000 0 400853+ 0 82636075+ 75828596+ 0 0 295335075+ 0 14150823 0.0 0 0 root N/A N/A N/A N/A N/A N/A





                share|improve this answer












                BSD ps doesn't show PID 0:



                $ ps -o pid,ppid,comm -p 0,1,$$
                PID PPID COMM
                1 0 /sbin/launchd
                14705 14704 -zsh


                Since pstree uses ps to get process information (as you can see in your output), obviously it can't show PID 0.



                Use top, or Activity Manager, on OSX to see PID 0:



                $ top -l1 -pid 0
                Processes: 480 total, 2 running, 478 sleeping, 2777 threads
                2018/11/15 12:20:36
                Load Avg: 1.99, 2.21, 2.13
                CPU usage: 6.59% user, 18.33% sys, 75.7% idle
                SharedLibs: 207M resident, 50M data, 40M linkedit.
                MemRegions: 135141 total, 7727M resident, 63M private, 2624M shared.
                PhysMem: 16G used (6717M wired), 61M unused.
                VM: 3304G vsize, 1297M framework vsize, 5481932(0) swapins, 6319905(0) swapouts.
                Networks: packets: 2367177/1916M in, 1966560/789M out.
                Disks: 2569936/63G read, 1879985/62G written.

                PID COMMAND %CPU TIME #TH #WQ #PORTS MEM PURG CMPRS PGRP PPID STATE BOOSTS %CPU_ME %CPU_OTHRS UID FAULTS COW MSGSENT MSGRECV SYSBSD SYSMACH CSW PAGEINS IDLEW POWER INSTRS CYCLES USER #MREGS RPRVT VPRVT VSIZE KPRVT KSHRD
                0 kernel_task 0.0 47:24.02 211/8 0 0 71M+ 0B 0B 0 0 running 0[0] 0.00000 0.00000 0 400853+ 0 82636075+ 75828596+ 0 0 295335075+ 0 14150823 0.0 0 0 root N/A N/A N/A N/A N/A N/A






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered yesterday









                Olorin

                1,514112




                1,514112



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f481829%2ffind-process-0-in-ps-tree%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

                    How to check contact read email or not when send email to Individual?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay