How to check my niceness?

The -o flag allows you to specify columns. If you want to see your nice level, this would be in the NI column. So to see all processes with their nice level, do something like:

ps ax -o pid,ni,cmd
This will list the process ID, the nice level, and the actual command.


Example:

  $ps ax -o pid,ni,cmd
  PID  NI CMD
    1   0 /sbin/init
    2  -5 [kthreadd]
    3   - [migration/0]
    4  -5 [ksoftirqd/0]
    5   - [watchdog/0]
    6   - [migration/1]
    7  -5 [ksoftirqd/1]
    8   - [watchdog/1]

I suggest you to use htop. It is a great monitoring application which also shows you the niceness of each process running on your box.


There is an easier way than using the -o flag. The -l (lowercase L) flag of the ps command displays the nice values and current priority values of the specified processes.

ps -l PID

ps -lu USERNAME
  • Blatantly swiped from IBM, https://www.ibm.com/support/knowledgecenter/en/ssw_aix_71/com.ibm.aix.performance/display_process_prior_ps.htm

Tags:

Ps

Nice