Show "top" on console w/o logging in.

Just wondering if it it possible. I like having top running to monitor apache & mysql loads but would rather not leave the console logged in.

Regards,

Monty
 
I can't test it right now, but maybe you can redirect top to a different terminal.
Code:
top > /dev/tty??

Or write a shell script that updates the proc list instead of top in case top messes up your output screen.
something like this:

Code:
#!/bin/bash 
x=0
while [ $x -lt 10 ]; do
  top -n 25 > /dev/tty??
  sleep 1
  clear > /dev/tty??
  let x=x+1 
done
 
top -n 25 > /dev/tty?? does work. I fiddled w/ creating another account called top and changed the shell to top.



MG said:
I can't test it right now, but maybe you can redirect top to a different terminal.
Code:
top > /dev/tty??

Or write a shell script that updates the proc list instead of top in case top messes up your output screen.
something like this:

Code:
#!/bin/bash 
x=0
while [ $x -lt 10 ]; do
  top -n 25 > /dev/tty??
  sleep 1
  clear > /dev/tty??
  let x=x+1 
done
 
monty_hall said:
Just wondering if it it possible. I like having top running to monitor apache & mysql loads but would rather not leave the console logged in.

I guess that you can do this by using Bash's prompt :)
 
Back
Top