What is a command to find priority of process in Linux?

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











up vote
13
down vote

favorite
1












How can i view the priority of a specific process ?










share|improve this question



























    up vote
    13
    down vote

    favorite
    1












    How can i view the priority of a specific process ?










    share|improve this question

























      up vote
      13
      down vote

      favorite
      1









      up vote
      13
      down vote

      favorite
      1






      1





      How can i view the priority of a specific process ?










      share|improve this question















      How can i view the priority of a specific process ?







      linux process-management priority






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 24 '11 at 23:08









      Gilles

      512k12010151547




      512k12010151547










      asked Aug 24 '11 at 7:27









      Rupesh Pawar

      332359




      332359




















          6 Answers
          6






          active

          oldest

          votes

















          up vote
          9
          down vote



          accepted










          The top command lists the priority of running processes under the PR heading. If you have it installed, you can also search for a process and sort by priority in htop.






          share|improve this answer



























            up vote
            10
            down vote













            awk 'print $18' /proc/1337/stat (gets the prio for process 1337).



            Other options:



            Use ps -o pri. Specify the process id with -p 1337. Or, use -e to list all processes.



            Experiment with this as a starting point if you want more than just the priority:



            ps -e -o uid,pid,ppid,pri,ni,cmd





            share|improve this answer





























              up vote
              5
              down vote













              ps is probably the right way to go. You can then grep and awk your way to the relevant row and column






              share|improve this answer



























                up vote
                3
                down vote













                ps -o ni $(pidof processname)


                For example:



                ps -o ni $(pidof mysqld)

                # ps -o ni $(pidof mysqld)
                NI
                15





                share|improve this answer





























                  up vote
                  1
                  down vote













                  If you have a cut-down Linux distribution where ps and top does not give you priority information, you can parse the stat file of proc for your process ID to get the priority information.



                  cat /proc/PID/stat | awk 'print "priority " $18 " nice " $19'


                  The values at position 18 and 19 of stat file represent priority and nice



                  For more: https://linux.die.net/man/5/proc






                  share|improve this answer





























                    up vote
                    0
                    down vote













                    ps -le | grep 'process name'

                    ps -lp 'PID of specific process'





                    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: 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%2f19301%2fwhat-is-a-command-to-find-priority-of-process-in-linux%23new-answer', 'question_page');

                      );

                      Post as a guest






























                      6 Answers
                      6






                      active

                      oldest

                      votes








                      6 Answers
                      6






                      active

                      oldest

                      votes









                      active

                      oldest

                      votes






                      active

                      oldest

                      votes








                      up vote
                      9
                      down vote



                      accepted










                      The top command lists the priority of running processes under the PR heading. If you have it installed, you can also search for a process and sort by priority in htop.






                      share|improve this answer
























                        up vote
                        9
                        down vote



                        accepted










                        The top command lists the priority of running processes under the PR heading. If you have it installed, you can also search for a process and sort by priority in htop.






                        share|improve this answer






















                          up vote
                          9
                          down vote



                          accepted







                          up vote
                          9
                          down vote



                          accepted






                          The top command lists the priority of running processes under the PR heading. If you have it installed, you can also search for a process and sort by priority in htop.






                          share|improve this answer












                          The top command lists the priority of running processes under the PR heading. If you have it installed, you can also search for a process and sort by priority in htop.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Aug 24 '11 at 7:39









                          jasonwryan

                          47.7k14131180




                          47.7k14131180






















                              up vote
                              10
                              down vote













                              awk 'print $18' /proc/1337/stat (gets the prio for process 1337).



                              Other options:



                              Use ps -o pri. Specify the process id with -p 1337. Or, use -e to list all processes.



                              Experiment with this as a starting point if you want more than just the priority:



                              ps -e -o uid,pid,ppid,pri,ni,cmd





                              share|improve this answer


























                                up vote
                                10
                                down vote













                                awk 'print $18' /proc/1337/stat (gets the prio for process 1337).



                                Other options:



                                Use ps -o pri. Specify the process id with -p 1337. Or, use -e to list all processes.



                                Experiment with this as a starting point if you want more than just the priority:



                                ps -e -o uid,pid,ppid,pri,ni,cmd





                                share|improve this answer
























                                  up vote
                                  10
                                  down vote










                                  up vote
                                  10
                                  down vote









                                  awk 'print $18' /proc/1337/stat (gets the prio for process 1337).



                                  Other options:



                                  Use ps -o pri. Specify the process id with -p 1337. Or, use -e to list all processes.



                                  Experiment with this as a starting point if you want more than just the priority:



                                  ps -e -o uid,pid,ppid,pri,ni,cmd





                                  share|improve this answer














                                  awk 'print $18' /proc/1337/stat (gets the prio for process 1337).



                                  Other options:



                                  Use ps -o pri. Specify the process id with -p 1337. Or, use -e to list all processes.



                                  Experiment with this as a starting point if you want more than just the priority:



                                  ps -e -o uid,pid,ppid,pri,ni,cmd






                                  share|improve this answer














                                  share|improve this answer



                                  share|improve this answer








                                  edited Apr 9 '14 at 7:31

























                                  answered Aug 25 '11 at 7:47









                                  MattBianco

                                  2,19231839




                                  2,19231839




















                                      up vote
                                      5
                                      down vote













                                      ps is probably the right way to go. You can then grep and awk your way to the relevant row and column






                                      share|improve this answer
























                                        up vote
                                        5
                                        down vote













                                        ps is probably the right way to go. You can then grep and awk your way to the relevant row and column






                                        share|improve this answer






















                                          up vote
                                          5
                                          down vote










                                          up vote
                                          5
                                          down vote









                                          ps is probably the right way to go. You can then grep and awk your way to the relevant row and column






                                          share|improve this answer












                                          ps is probably the right way to go. You can then grep and awk your way to the relevant row and column







                                          share|improve this answer












                                          share|improve this answer



                                          share|improve this answer










                                          answered Aug 24 '11 at 8:12









                                          Sarah

                                          1512




                                          1512




















                                              up vote
                                              3
                                              down vote













                                              ps -o ni $(pidof processname)


                                              For example:



                                              ps -o ni $(pidof mysqld)

                                              # ps -o ni $(pidof mysqld)
                                              NI
                                              15





                                              share|improve this answer


























                                                up vote
                                                3
                                                down vote













                                                ps -o ni $(pidof processname)


                                                For example:



                                                ps -o ni $(pidof mysqld)

                                                # ps -o ni $(pidof mysqld)
                                                NI
                                                15





                                                share|improve this answer
























                                                  up vote
                                                  3
                                                  down vote










                                                  up vote
                                                  3
                                                  down vote









                                                  ps -o ni $(pidof processname)


                                                  For example:



                                                  ps -o ni $(pidof mysqld)

                                                  # ps -o ni $(pidof mysqld)
                                                  NI
                                                  15





                                                  share|improve this answer














                                                  ps -o ni $(pidof processname)


                                                  For example:



                                                  ps -o ni $(pidof mysqld)

                                                  # ps -o ni $(pidof mysqld)
                                                  NI
                                                  15






                                                  share|improve this answer














                                                  share|improve this answer



                                                  share|improve this answer








                                                  edited Oct 12 '15 at 7:31

























                                                  answered Oct 11 '15 at 19:59









                                                  Paul

                                                  36116




                                                  36116




















                                                      up vote
                                                      1
                                                      down vote













                                                      If you have a cut-down Linux distribution where ps and top does not give you priority information, you can parse the stat file of proc for your process ID to get the priority information.



                                                      cat /proc/PID/stat | awk 'print "priority " $18 " nice " $19'


                                                      The values at position 18 and 19 of stat file represent priority and nice



                                                      For more: https://linux.die.net/man/5/proc






                                                      share|improve this answer


























                                                        up vote
                                                        1
                                                        down vote













                                                        If you have a cut-down Linux distribution where ps and top does not give you priority information, you can parse the stat file of proc for your process ID to get the priority information.



                                                        cat /proc/PID/stat | awk 'print "priority " $18 " nice " $19'


                                                        The values at position 18 and 19 of stat file represent priority and nice



                                                        For more: https://linux.die.net/man/5/proc






                                                        share|improve this answer
























                                                          up vote
                                                          1
                                                          down vote










                                                          up vote
                                                          1
                                                          down vote









                                                          If you have a cut-down Linux distribution where ps and top does not give you priority information, you can parse the stat file of proc for your process ID to get the priority information.



                                                          cat /proc/PID/stat | awk 'print "priority " $18 " nice " $19'


                                                          The values at position 18 and 19 of stat file represent priority and nice



                                                          For more: https://linux.die.net/man/5/proc






                                                          share|improve this answer














                                                          If you have a cut-down Linux distribution where ps and top does not give you priority information, you can parse the stat file of proc for your process ID to get the priority information.



                                                          cat /proc/PID/stat | awk 'print "priority " $18 " nice " $19'


                                                          The values at position 18 and 19 of stat file represent priority and nice



                                                          For more: https://linux.die.net/man/5/proc







                                                          share|improve this answer














                                                          share|improve this answer



                                                          share|improve this answer








                                                          edited Mar 3 '17 at 2:55

























                                                          answered Mar 3 '17 at 1:22









                                                          Razan Paul

                                                          1114




                                                          1114




















                                                              up vote
                                                              0
                                                              down vote













                                                              ps -le | grep 'process name'

                                                              ps -lp 'PID of specific process'





                                                              share|improve this answer
























                                                                up vote
                                                                0
                                                                down vote













                                                                ps -le | grep 'process name'

                                                                ps -lp 'PID of specific process'





                                                                share|improve this answer






















                                                                  up vote
                                                                  0
                                                                  down vote










                                                                  up vote
                                                                  0
                                                                  down vote









                                                                  ps -le | grep 'process name'

                                                                  ps -lp 'PID of specific process'





                                                                  share|improve this answer












                                                                  ps -le | grep 'process name'

                                                                  ps -lp 'PID of specific process'






                                                                  share|improve this answer












                                                                  share|improve this answer



                                                                  share|improve this answer










                                                                  answered Oct 1 at 5:31









                                                                  firo

                                                                  26035




                                                                  26035



























                                                                       

                                                                      draft saved


                                                                      draft discarded















































                                                                       


                                                                      draft saved


                                                                      draft discarded














                                                                      StackExchange.ready(
                                                                      function ()
                                                                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f19301%2fwhat-is-a-command-to-find-priority-of-process-in-linux%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?