43

It there a way to display the complete command line in htop (e.g. in multiple lines or with a moving banner). With the default setting where only one line is displayed it isn't possible to distungish all processes, e.g. different java programs (because class or jar argument follows a bunch of arguments) or programs with long absolute path of binaries.

Omitting the full absolute path in favour of only the binary would be a compromise where distinction would not be optimal, but better in some cases.

I checked out the settings and the manpage and didn't find an option suitable in my understanding.

  • 1
    Something like this for p in $(pidof java); do echo $p:; cat /proc/$p/cmdline| xargs -0 echo; done |less to inspect pids commandline? – Alex Oct 02 '14 at 19:59

4 Answers4

47

As far as I know, the only way to show the full command line is to scroll right with the arrow keys or to use a terminal with a small font.

EDIT (thanks to @LangeHaare): You can use Ctrl-A and Ctrl-E to jump to the beginning and end the command line.

jofel
  • 26,758
13

Just press the w key.

From the help available with F1:

w: wrap process command in multiple lines

Stephen Kitt
  • 434,908
danykey
  • 146
  • 1
  • 2
  • 1
    cool tips, only works with more recent version of htop (ubuntu 20.04's repo version not included) – n0tis Jul 06 '23 at 11:25
6

ctrl+f and use arrow key to move left and right.

0

A couple of options of htop which do not wrap the line, but at least reduce the content are:

  • p: Show full paths to running programs, where applicable. (This is a toggle key.)
  • m: Merge exe, comm and cmdline, where applicable. (This is a toggle key.)

With this we can move from, in iOS and Chrome for example:

/Applications/Google Chrome.app/Contents/MacOS/Google Chrome -> Google Chrome

More info at https://man7.org/linux/man-pages/man1/htop.1.html