# Can top be wider than 128 columns



## FredMack (Aug 12, 2011)

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!


----------



## terminus (Aug 12, 2011)

```
top -n 100500
```


----------



## FredMack (Aug 15, 2011)

Thanks, but that only seems to put top into non-interactive mode.
Any other ideas?


----------



## terminus (Aug 15, 2011)

```
while true; do top -n 100000; sleep 2; clear; done
```


Why are you need this?


----------



## wblock@ (Aug 15, 2011)

-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.


----------



## freethread (Aug 15, 2011)

sysutils/htop can. It's a bit slow and eat a lot of resources. It works without linux comp layer.


----------



## FredMack (Aug 18, 2011)

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.


----------



## freethread (Aug 19, 2011)

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.


----------



## wblock@ (Aug 19, 2011)

Does it have to be top?  For example,

nottop

```
#!/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
```


----------



## freethread (Aug 19, 2011)

fast and practical solution, I use something similar on another os.



			
				wblock said:
			
		

> ```
> #!/bin/sh
> CMDNAME=`basename $0`
> PATTERN=$1
> ...



should be *-wax*?


----------



## wblock@ (Aug 19, 2011)

freethread said:
			
		

> should be *-wax*?



Nope, ps(1) can take both forms of options like tar(1).  Two "w"s is for extra doubleyewey goodness.


----------

