Re: sort "top" output and then save to file



% ps -eo pid,size,vsize,cmd --sort vsize

Genti Hila wrote:
I tried this and works ok but I need to see the memory size in kb or Mb and
not sort simply by percentage.

Thanks,

On Mon, Apr 28, 2008 at 4:22 PM, Jai Rangi <jrangi@xxxxxxxxxxxxxx> wrote:

Something like this,
% ps aux | sort -nr -k +4


-Jai Rangi




-----Original Message-----
From: redhat-list-bounces@xxxxxxxxxx
[mailto:redhat-list-bounces@xxxxxxxxxx] On Behalf Of Paul Copeland
Sent: Monday, April 28, 2008 1:14 PM
To: General Red Hat Linux discussion list
Subject: RE: sort "top" output and then save to file

Use ps command. Get the columns and sort you want and redirect the
output - Assumming you want a snapshot.

-----Original Message-----
From: redhat-list-bounces@xxxxxxxxxx
[mailto:redhat-list-bounces@xxxxxxxxxx] On Behalf Of Genti Hila
Sent: Monday, April 28, 2008 1:12 PM
To: redhat-list@xxxxxxxxxx
Subject: sort "top" output and then save to file

I am trying to save all the processes into a file by using top command:

top -cSb n 1 > proc.txt

It works fine but I want to sort it descending by the amount of memory
each proccess takes (descending).

I know how to do that interactively but how can i do when I run it as a
batch and save the output to a file.

I need to see some program that I think has some memory leaking problem.
--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list


--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list


--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list



Relevant Pages

  • Re: FC1 Install _appeared_ to work, BUT...
    ... what sort of messages do make it to screen? ... I used to run RHL7.3, dual booting, on a Sony Vaio laptop. ... command prompt only safe-mode in windows but without the GUI). ...
    (Fedora)
  • Re: [OT] Compiler warning level
    ... > have command lines" when they enter the course. ... I started -- well, OK, unless you count the front panel switches and the ... lights on the panel could be called a GUI, they were sort of graphical ... I tend to write the makefile before typing in the start of the ...
    (comp.lang.c)
  • Re: getline caveats misuse howto
    ... populates the ERRNO builtin variable if getline fails. ... down the two-way pipe to the UNIX "sort" command. ... gawk terminates the coprocess and exits. ...
    (comp.lang.awk)
  • Re: BROWSE: order by column
    ... oHdr is now a reference to the header object ... descending sort. ... If you have a lot of columns that would be a lot of command ... Just add the code to change the sort order to a new ...
    (microsoft.public.fox.programmer.exchange)
  • Re: [SLE] Missing space on my hard drive, 100% used and deleting files gives back no space.
    ... then reports on the file system that holds those files or directories. ... You can see what's mounted by using the "mount" command or by viewing ... And if the list you need to sort doesn't have ... read about sort's key field selection options. ...
    (SuSE)