How can I see the processes structured by sessions and process groups?

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











up vote
-1
down vote

favorite












As far as I know, linux kenerl has sessions and process groups concept, I want to see the sessions and groups, what should I do?










share|improve this question

























    up vote
    -1
    down vote

    favorite












    As far as I know, linux kenerl has sessions and process groups concept, I want to see the sessions and groups, what should I do?










    share|improve this question























      up vote
      -1
      down vote

      favorite









      up vote
      -1
      down vote

      favorite











      As far as I know, linux kenerl has sessions and process groups concept, I want to see the sessions and groups, what should I do?










      share|improve this question













      As far as I know, linux kenerl has sessions and process groups concept, I want to see the sessions and groups, what should I do?







      linux shell job-control






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Oct 1 at 14:21









      神秘德里克

      285112




      285112




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          6
          down vote













          You can use this command



           ps xao pid,ppid,pgid,sid,comm | less
          PID PPID PGID SID COMMAND
          1 0 1 1 systemd
          2 0 0 0 kthreadd
          3 2 0 0 ksoftirqd/0
          5 2 0 0 kworker/0:0H
          6 2 0 0 kworker/u64:0
          8 2 0 0 migration/0


          . . . .
          . . . .
          . . . .
          . . . .

          hit enter to see the next line

          PID - Process ID
          PPID - Parent Process ID
          PGIF - process group ID
          SID - Session ID


          for more check ps man



          If you would like to check specific PID then use this command:



          ps xao pid,ppid,pgid,sid,comm | grep <PID>


          or



          ps p <PID> o pid,ppid,pgid,sid,comm





          share|improve this answer


















          • 1




            or, for a specific pid without grepping: ps p PID o pid,ppid,pgid,sid,comm
            – Jeff Schaller
            Oct 1 at 16:52










          • @ Jeff Schaller very nice!! i will include it in the answer ;-)
            – Goro
            Oct 1 at 16:54










          • It doesn't seem to group my processes by session, but just tell me SID and PGID
            – ç¥žç§˜å¾·é‡Œå…‹
            Oct 3 at 0:38










          • What do you mean by It doesn't seem to group my processes by session?
            – Goro
            Oct 3 at 0:41










          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: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          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%2f472587%2fhow-can-i-see-the-processes-structured-by-sessions-and-process-groups%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          6
          down vote













          You can use this command



           ps xao pid,ppid,pgid,sid,comm | less
          PID PPID PGID SID COMMAND
          1 0 1 1 systemd
          2 0 0 0 kthreadd
          3 2 0 0 ksoftirqd/0
          5 2 0 0 kworker/0:0H
          6 2 0 0 kworker/u64:0
          8 2 0 0 migration/0


          . . . .
          . . . .
          . . . .
          . . . .

          hit enter to see the next line

          PID - Process ID
          PPID - Parent Process ID
          PGIF - process group ID
          SID - Session ID


          for more check ps man



          If you would like to check specific PID then use this command:



          ps xao pid,ppid,pgid,sid,comm | grep <PID>


          or



          ps p <PID> o pid,ppid,pgid,sid,comm





          share|improve this answer


















          • 1




            or, for a specific pid without grepping: ps p PID o pid,ppid,pgid,sid,comm
            – Jeff Schaller
            Oct 1 at 16:52










          • @ Jeff Schaller very nice!! i will include it in the answer ;-)
            – Goro
            Oct 1 at 16:54










          • It doesn't seem to group my processes by session, but just tell me SID and PGID
            – ç¥žç§˜å¾·é‡Œå…‹
            Oct 3 at 0:38










          • What do you mean by It doesn't seem to group my processes by session?
            – Goro
            Oct 3 at 0:41














          up vote
          6
          down vote













          You can use this command



           ps xao pid,ppid,pgid,sid,comm | less
          PID PPID PGID SID COMMAND
          1 0 1 1 systemd
          2 0 0 0 kthreadd
          3 2 0 0 ksoftirqd/0
          5 2 0 0 kworker/0:0H
          6 2 0 0 kworker/u64:0
          8 2 0 0 migration/0


          . . . .
          . . . .
          . . . .
          . . . .

          hit enter to see the next line

          PID - Process ID
          PPID - Parent Process ID
          PGIF - process group ID
          SID - Session ID


          for more check ps man



          If you would like to check specific PID then use this command:



          ps xao pid,ppid,pgid,sid,comm | grep <PID>


          or



          ps p <PID> o pid,ppid,pgid,sid,comm





          share|improve this answer


















          • 1




            or, for a specific pid without grepping: ps p PID o pid,ppid,pgid,sid,comm
            – Jeff Schaller
            Oct 1 at 16:52










          • @ Jeff Schaller very nice!! i will include it in the answer ;-)
            – Goro
            Oct 1 at 16:54










          • It doesn't seem to group my processes by session, but just tell me SID and PGID
            – ç¥žç§˜å¾·é‡Œå…‹
            Oct 3 at 0:38










          • What do you mean by It doesn't seem to group my processes by session?
            – Goro
            Oct 3 at 0:41












          up vote
          6
          down vote










          up vote
          6
          down vote









          You can use this command



           ps xao pid,ppid,pgid,sid,comm | less
          PID PPID PGID SID COMMAND
          1 0 1 1 systemd
          2 0 0 0 kthreadd
          3 2 0 0 ksoftirqd/0
          5 2 0 0 kworker/0:0H
          6 2 0 0 kworker/u64:0
          8 2 0 0 migration/0


          . . . .
          . . . .
          . . . .
          . . . .

          hit enter to see the next line

          PID - Process ID
          PPID - Parent Process ID
          PGIF - process group ID
          SID - Session ID


          for more check ps man



          If you would like to check specific PID then use this command:



          ps xao pid,ppid,pgid,sid,comm | grep <PID>


          or



          ps p <PID> o pid,ppid,pgid,sid,comm





          share|improve this answer














          You can use this command



           ps xao pid,ppid,pgid,sid,comm | less
          PID PPID PGID SID COMMAND
          1 0 1 1 systemd
          2 0 0 0 kthreadd
          3 2 0 0 ksoftirqd/0
          5 2 0 0 kworker/0:0H
          6 2 0 0 kworker/u64:0
          8 2 0 0 migration/0


          . . . .
          . . . .
          . . . .
          . . . .

          hit enter to see the next line

          PID - Process ID
          PPID - Parent Process ID
          PGIF - process group ID
          SID - Session ID


          for more check ps man



          If you would like to check specific PID then use this command:



          ps xao pid,ppid,pgid,sid,comm | grep <PID>


          or



          ps p <PID> o pid,ppid,pgid,sid,comm






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Oct 1 at 16:54

























          answered Oct 1 at 14:40









          Goro

          7,02252965




          7,02252965







          • 1




            or, for a specific pid without grepping: ps p PID o pid,ppid,pgid,sid,comm
            – Jeff Schaller
            Oct 1 at 16:52










          • @ Jeff Schaller very nice!! i will include it in the answer ;-)
            – Goro
            Oct 1 at 16:54










          • It doesn't seem to group my processes by session, but just tell me SID and PGID
            – ç¥žç§˜å¾·é‡Œå…‹
            Oct 3 at 0:38










          • What do you mean by It doesn't seem to group my processes by session?
            – Goro
            Oct 3 at 0:41












          • 1




            or, for a specific pid without grepping: ps p PID o pid,ppid,pgid,sid,comm
            – Jeff Schaller
            Oct 1 at 16:52










          • @ Jeff Schaller very nice!! i will include it in the answer ;-)
            – Goro
            Oct 1 at 16:54










          • It doesn't seem to group my processes by session, but just tell me SID and PGID
            – ç¥žç§˜å¾·é‡Œå…‹
            Oct 3 at 0:38










          • What do you mean by It doesn't seem to group my processes by session?
            – Goro
            Oct 3 at 0:41







          1




          1




          or, for a specific pid without grepping: ps p PID o pid,ppid,pgid,sid,comm
          – Jeff Schaller
          Oct 1 at 16:52




          or, for a specific pid without grepping: ps p PID o pid,ppid,pgid,sid,comm
          – Jeff Schaller
          Oct 1 at 16:52












          @ Jeff Schaller very nice!! i will include it in the answer ;-)
          – Goro
          Oct 1 at 16:54




          @ Jeff Schaller very nice!! i will include it in the answer ;-)
          – Goro
          Oct 1 at 16:54












          It doesn't seem to group my processes by session, but just tell me SID and PGID
          – ç¥žç§˜å¾·é‡Œå…‹
          Oct 3 at 0:38




          It doesn't seem to group my processes by session, but just tell me SID and PGID
          – ç¥žç§˜å¾·é‡Œå…‹
          Oct 3 at 0:38












          What do you mean by It doesn't seem to group my processes by session?
          – Goro
          Oct 3 at 0:41




          What do you mean by It doesn't seem to group my processes by session?
          – Goro
          Oct 3 at 0:41

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f472587%2fhow-can-i-see-the-processes-structured-by-sessions-and-process-groups%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

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

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?