At times I like to check my levels of disk and memory usage and it’s more available for me at times for me to do it from the command line. Therefore, I created two scripts for them:
$ devtop
Filesystem Size Used Avail Use% Mounted
/dev/sda1 291G 101G 187G 36% /
/dev/sda2 166G 38G 121G 24% /home
$ memtop
PROGRAM %MEM #MEM
firefox 14.0 1049.7 MiB
gnome-shell 2.2 165.84 MiB
thunderbird 1.9 143.773 MiB
gedit 0.8 63.8555 MiB
nautilus 0.6 44.9961 MiB
Xorg 0.5 38.5039 MiB
gnome-terminal- 0.3 28.8164 MiB
keepassx 0.3 27.6406 MiB
tracker-extract 0.2 21.1992 MiB
Both script are part of my genscripts-git that is in the Arch Linux User Repository.
Hi, thanks for the scripts!
I’ve modified memtop a little bit — added a header with the overall memory info. Here is my version: https://gist.github.com/3243054
BTW, there is a similar script to your devtop: http://freecode.com/projects/pydf It does about the same thing, but also adds colors.
Cheers,
Anton
Nice work on the script, I could see how overall memory usage could be useful.
Had not heard about pydf before, thanks for bringing that to my information.
Updated script to a more read able formatting, and output.
Two things regarding ‘memtop’:
1. I see ‘python2’ in the output – is it some kind of script / app? How do you know which one is it? ;P
2. ‘head -n 10’ will print the first 10 lines (and it happens to be the default so you can use plain ‘head’). If you want top ten processes, you should use ‘head -n 11’, as did the author. Either way, that script doesn’t print “top five applications” like you say in the comment in the script :-)
Good points.
Yeah, that’s python2 a programming language a lot of programs use :) (see it a lot on GNOME 3 even).
Yeah, I knew about head by default showing 10 lines; however, I decided to define it because I thought I (or others) may want to change it. The, er, five applications, thing was my bad, oops, thanks for pointing it out.