FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 05-16-2008, 11:39 AM
avilella
 
Default top command results from an ssh

Hi,

how can I get the results of doing a "top" sorted by memory usage from
an ssh command?

Sth like:

ssh a-computer top

Is this doable?


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 05-16-2008, 12:21 PM
Jochen Schulz
 
Default top command results from an ssh

avilella:
>
> how can I get the results of doing a "top" sorted by memory usage from
> an ssh command?

I am not sure what exactly you are trying to do, but

$ ssh -t host top

will show top's output from the remote host in your current terminal.
You need the -t option when you want to force ssh to open a
pseudo-terminal. Ssh doesn't do that normally when you give it a command
to execute.

I cannot find a command line option to make top sort entries by memory
usage upon start, buy you can press 'M' while top is running and then
press 'W' and enter to save the current settings. These will be read
when top is started again, so it will probably achieve what you want.

J.
--
After the millenium I will shoot to kill.
[Agree] [Disagree]
<http://www.slowlydownward.com/NODATA/data_enter2.html>
 
Old 05-16-2008, 12:23 PM
Mike Bird
 
Default top command results from an ssh

On Fri May 16 2008 04:39:10 avilella wrote:
> how can I get the results of doing a "top" sorted by memory usage from
> an ssh command?
>
> Sth like:
>
> ssh a-computer top
>
> Is this doable?

It's doable but ugly:

ssh a-computer top -b -n1 | tail -n+8 | sort -n -k1.46,1.50

You might want to see if ps fits your needs, e.g.:

ssh a-computer ps vax --sort=rss

--Mike Bird


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 03:10 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org