Can top be wider than 128 columns

Hi guys,

This seems like it should have a simple solution but I haven't been able to find one.

'top -a' seems to truncate at 128 columns - is there any way to make this wider?

Thanks!
 
-n just makes top non-interactive. The number after it determines how many processes are shown. Neither of those things makes it produce a wider output, which will probably require changes to the source.
 
terminus - I have long lines that I'm trying to keep an eye on eg
/usr/bin/perl -w /quite/a/long/path/to/perl/script/script.pl arguments
often top will only show part of the argument.

freethread Thanks, I'll check out htop, but if it is resource-intensive I won't be able to use it consistently.
 
FredMack said:
freethread Thanks, I'll check out htop, but if it is resource-intensive I won't be able to use it consistently.

I exagerated, it is resource-intensive respect to top, on old machines it measure its own performances but on modern machines it is transparent like top. Anyways it also has a line length limit, I'm not sure, it should be 256 chars, more or less.
 
Does it have to be top? For example,

nottop
Code:
#!/bin/sh
CMDNAME=`basename $0`
PATTERN=$1

if [ "$#" -lt 1 ]; then
  echo "${CMDNAME}: show processes running"
  echo "Usage:"
  echo "  ${CMDNAME} pattern"
  exit 0
fi

while true; do
  clear
  ps wwax | grep ${PATTERN} | egrep -v "${CMDNAME}|grep" | head -n 20
  sleep 1
done
 
fast and practical solution, I use something similar on another os.

wblock said:
Code:
#!/bin/sh
CMDNAME=`basename $0`
PATTERN=$1

if [ "$#" -lt 1 ]; then
  echo "${CMDNAME}: show processes running"
  echo "Usage:"
  echo "  ${CMDNAME} pattern"
  exit 0
fi

while true; do
  clear
  ps [color="Red"]wwax[/color] | grep ${PATTERN} | egrep -v "${CMDNAME}|grep" | head -n 20
  sleep 1
done

should be -wax?
 
Back
Top