46

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
  • 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? Commented Oct 2, 2014 at 19:59

4 Answers 4

50

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.

5
  • 9
    Do you know whether there's a way to jump to the end and back to the beginning of the command line? Dealing with java command lines containing the complete classpath can lead up to > 2000 signs easily... Commented Oct 2, 2014 at 11:32
  • @Karl To the right end? or down end? Commented Oct 2, 2014 at 13:37
  • @tachomi The right end (and left end, i.e. the view right after start) Commented Oct 2, 2014 at 15:04
  • 11
    @KarlRichter you can use CTRL+A and CTRL+E to go to start and end of the scrolling Commented Nov 20, 2017 at 17:11
  • There is a feature request but it has been refused: github.com/hishamhm/htop/issues/233 Commented Mar 21, 2019 at 16:20
15

Just press the w key.

From the help available with F1:

w: wrap process command in multiple lines

1
  • 1
    cool tips, only works with more recent version of htop (ubuntu 20.04's repo version not included) Commented Jul 6, 2023 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

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.