2

I have the below output from top command. Where is the process priority of the processes?

Mem: 678048K used, 336240K free, 0K shrd, 4K buff, 523012K cached
CPU:  0.5% usr 26.1% sys  0.0% nic 72.9% idle  0.0% io  0.0% irq  0.4% sirq
Load average: 1.89 1.75 1.62 3/154 3595
  PID  PPID USER     STAT   VSZ %VSZ CPU %CPU COMMAND
 3794     1 root     R     1992  0.2   0 19.5 /usr/sbin/syslogd
  297     2 root     SW       0  0.0   0  4.0 [ocf_0]
  299     2 root     SW       0  0.0   1  0.5 [ocf_1]
 1152     1 root     S     4032  0.4   1  0.3 /usr/sbin/procrecovery_mgr
 1100     2 root     SW       0  0.0   1  0.2 [ubi_bgt0d]
 1330     2 root     DW       0  0.0   1  0.2 [pfe_ctrl_timer]

1 Answer 1

4

It is called the nice value, and is shown by default in some of the configurations of top. If it is not showing by default, you can do the following

  1. Execute top
  2. Press f
  3. Navigate to the line beginning with NI and press Space
  4. Press q to return to the main view.

This is documented in sections 3a and 3b of the manpages of top.

Edit: @Kusalananda has pointed out that priority is not the same as the nice value. The OP should examine the definitions of both and choose the appropriate one to use for his purpose.

To access the priority, change the NI in step 3 to PR.

My top is showing both priority and nice value by default.

5
  • 1
    The priority is not the same as the nice value, and top can show both.
    – Kusalananda
    Commented Jan 16, 2018 at 9:01
  • Tried to move to nice value as mentioned above, but it does not work [no navigation exists]. Is there any other way to check the process priority?
    – Ravi
    Commented Jan 30, 2018 at 5:35
  • @Ravi If it shows "toggle with letter" instead of navigation, just press the corresponding letter to show the column you need. Commented Jan 30, 2018 at 5:45
  • Don't you mean to press s on the NI field, NOT Space on it? s sets it to sort by that field. Commented Dec 13, 2022 at 23:10
  • Space is toggling the visibility of the field and s is for sorting. One may need both depending on the situations. Commented Dec 14, 2022 at 3:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .