Linux "top -c" to show full command

What parameter can help me to display the full command using top -c?

For example, I have one of the oupput from top -c

 5073 mysql 20 0 298m 12m 4668 S 0 0.0 29:27.46 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --log-error=/var/log/mysql/mysqld.log --pid-file=/var/run/mysql/mysqld.pid -

There are more parameters after --pid-file==/var/run/mysql/mysqld.pid, but they are chopped off as the screen size. How can I make them visible?

3

4 Answers

top per se doesn't support wrapping, if i am correct. One way is you can increase your terminal width as follows.

export COLUMNS=_NO_YOU_DESIRE_
top
** then set update interval with 's _REFRESH_INTERVAL_'
** turn on command line display with 'c'
1

htop shows the full command. You can scroll to the right to see it all.

htop screenshot

You can also rearrange, add and remove the columns to just show the information you are interested in. Press h inside top for details (or man htop in the terminal).

What helped was using the -O option to move the command to the leftmost column and then -f to remove most of the other items. I was interested to see only the full command which was being run.

3

You could use something like ps -eF > ps_out to get a snapshot of your current processes, with all the command line arguments. Or use htop which supports scrolling.

hth

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like