Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

How can i view the priority of a specific process ?

share|improve this question

3 Answers 3

up vote 4 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

Your Answer

 
discard

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.