Archive for November, 2012

A useful command line tool: watch

Tuesday, November 13th, 2012

It’s 2012, almost 2013, I’ve been working with Linux for 9 to 15 years (depending on how you count) and yet occasionally I come across useful things unknown to me once in a while:

Enter ‘watch’

In a sense, it’s working the switch ‘-f’ in ‘tail’ but it’s doing its magic on files and commands.

By default, it displays every two seconds whatever command you supply it with. Rather than hitting up arrow and Enter every two seconds, issue one elegant ‘watch ps -ef | grep myprocess’ and lean back while your fellow linux newbies play the old hackin’-away-at-the-keyboard game.

Other than ‘have a look at the man page!’, I can’t really think of anything else left to write to here, so my job is done here.