Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

migrated from stackoverflow.com May 8 '12 at 8:46

This question came from our site for professional and enthusiast programmers.

1  
Why do you ask? Why don't you use e.g. ps auxww, perhaps thru watch ? –  Basile Starynkevitch May 8 '12 at 7:42
    
You could use htop which supports scrolling. –  ortang May 8 '12 at 8:21
    
@BasileStarynkevitch, goog question, I am not used to using "ps", but it is nice to know, thanks. –  user200340 May 8 '12 at 8:49

3 Answers 3

up vote 5 down vote accepted

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'
share|improve this answer
    
With zsh at least, this has undesirable side effects like shifting the right hand side prompt, and the initial position of the cursor. –  Sridhar-Sarnobat Jun 18 at 18:12

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.

share|improve this answer
    
There doesn't seem to be an -O or -f argument to top. –  Daniel Beck Aug 21 '13 at 19:24
    
Press o inside top to move columns left and right. Press f inside top to toggle columns. –  Evgeni Sergeev Dec 15 '13 at 23:28
    
After all the customisation, you may wish to press W for top to remember those settings for next time it starts. –  Evgeni Sergeev Dec 15 '13 at 23:33

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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