Watch Command

October 27, 2017

I love learning new unix commands because there is infinite ways to become more productive. When you work alongside some unix power user wizards like I do I frequently retrace through the history to analyze how they did something. At the moment, my new favorite is watch. A basic example I've used a few times already is:

watch 'ls -la | grep somefile.txt'

By default this will refresh a file list every 2 seconds. It has other cool options I need to explore like changing the refresh time and highlighting changes in a new color. Super useful when you're monitoring for something. 

Apparently you can install this on Mac OS X via Homebrew brew install watch.