Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 you make htop sort the list of processes by PID?

share|improve this question
up vote 6 down vote accepted
htop --sort-key PID

appears to work. Found it via htop --help.

htop --sort-key help

shows a list of all the column keys.

share|improve this answer
thanks for htop --sort-key help – Cyril Dec 2 '14 at 15:09

Press F6 and select PID...

share|improve this answer
Is there another way without having to press F6? – tony_sid Apr 27 '11 at 5:37
@OSX Press >. – Daniel Beck Apr 27 '11 at 5:39
That causes the program to crash. – tony_sid Apr 27 '11 at 5:47
@OSX It works on my machine and is documented in htop's man page. It would work if you didn't have another issue. – Daniel Beck Apr 27 '11 at 5:48
I'm going to upvote you only because I think the OP is a little stingy here - there's nothing wrong with F6, and almost keyboard where it doesn't exist (with few exceptions). – new123456 Apr 27 '11 at 22:55

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.