code: Select all
#!/bin/bash
lines=`tput lines`
((lines-=2))
ps u -e | sort -rnk 4 | head -$linesQuite useful to find out what is consuming most memory. Of course, graphical task viewers like KDE's often do this for you too. This will adjust itself to your terminal size, too.