What does 'N'sort by?

QuestionsQuestions8 SkillsProDec, 21 2025
095

In the top command, pressing N (upper-case, so Shift + n) sorts the process list by PID (Process ID).

Here is why that is useful:

  1. Numerical Order: It organizes the list starting from the lowest PID number to the highest.
  2. Creation Order: Since Linux usually assigns PIDs in increasing order, sorting by N often places the oldest processes (like system services that started at boot) at the top and the most recently started processes at the bottom.
  3. Stability: Unlike sorting by CPU (P) or Memory (M), which causes the rows to jump around constantly as usage fluctuations, sorting by PID keeps the list relatively still, making it easier to read specific process details.

Give it a try:

  1. While top is running, press Shift + n.
  2. You will see the PID column on the far left become organized numerically.
  3. Press P if you want to switch back to sorting by CPU usage.

Do you have any other questions about the columns in top?

0 Comments

no data
Be the first to share your comment!