I'm running a rails stack on ubuntu.

When I ps -AF, I get a descriptive process name set by the apache module like

00:00:43 Rails: /var/www...

which is really helpful in diagnosing load issues.

But when I top, the same process show up simply as


Is there any way to get the ps -AF process name in top?


While top is running, you can press c to toggle between showing the process name and the command line. To remember the toggle state for next time, press W to save the current configuration to ~/.toprc.


This is more of a general suggestion, than an answer:

Try out htop. It shows the full process name by default and I think it's much easier to use.

  • 2
    great! much better than the raw 'top'. thanks a lot! – Siwei May 17 '13 at 0:32

top -c -n 1 should give you what you want.

  • -c: automatically toggles between command line and program name
  • -n 1: this makes top to exit out immediately without showing the updates every 3 seconds (by default)

When running top type c to toggle command line/process.


You could either press c while top is running or use htop. But, if I may, give glances a look as well. It could serve as an alternative.

Glances Home

I use it quite a bit and is really handy!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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