What is a command to find priority of process in Linux?
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
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
.
ps
is probably the right way to go. You can then grep and awk your way to the relevant row and column