Like top, but for files

I was restoring some 20GB of MySQL data today, but I’d forgotten to -v the command, leaving me to guess how far along I was in the process. To compensate for this, I threw together a quick script that acts a little like top, but for files. Observe.

watch --differences -n 5 'df; ls -FlAt;'

It basically says “keep printing out disk usage and recently modified files every 5 seconds until I say otherwise”. Run that inside of /var/lib/mysql/foo and you’re set.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>