Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can i view the priority of a specific process ?

share|improve this question
up vote 6 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

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

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
ps -o ni $(pidof processname)

For example:

ps -o ni $(pidof mysqld)

# ps -o ni $(pidof mysqld) 
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.