Read my blog with this tag
Follow my feed with this tag
Searching for: commandline
sorttop: show the biggest values as a program runs [01329670473]
When I am looking for big disk users, I don't care about all the little items.
What would be great is to continuously see the biggest items encountered so
far.
To this end, I've written a Python program I call 'sorttop'; it continually
reads stdin, sorts the first column according to magic (i.e., human numbers like from "du -h" work as expected), and shows the top items
read so far. Example usage: du -hx / | python sorttop.py
Update, Feb 20, 2012: Revised the script to work for more terminals;
fixes a traceback on the line 'bol = curses.tparm(ti_hpa, 0)' when TERM=screen.
Files currently attached to this page:
sorttop.py3.3kB