You are not logged in.

#1 2005-08-19 22:05:07

laddiebuck
Member
Registered: 2005-08-03
Posts: 14

Little Shell Script - Processes by Memory

#!/bin/bash
lines=`tput lines`
((lines-=2))
ps u -eww | sort -rnk 4 | head -$lines

I put that script in /usr/local/bin/proc-by-mem.sh
Quite useful to find out what is consuming most memory. Of course, graphical task viewers like KDE's (but not XFCE's) often do this for you too, as will programs like top and htop.

This will adjust itself to your terminal size, too.

Offline

#2 2005-08-19 22:43:20

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Little Shell Script - Processes by Memory

top
F
n
<return>

yeah. I just use top..
o.0


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#3 2005-08-21 21:55:57

laddiebuck
Member
Registered: 2005-08-03
Posts: 14

Re: Little Shell Script - Processes by Memory

Yes, as I noted, you can do that. But: slower, overkill, more keys, and can't be piped. wink

Offline

Board footer

Powered by FluxBB