Watch – A Useful Linux Command You May Have Never Heard Of

Posted by Artem Russakovskii on August 4th, 2007 in Linux

Updated: November 9th, 2007

How many times did I want to watch a directory waiting for a file to appear in it? Constant ls, for example, quickly got boring. A quick Perl script that would reload ls every 5 seconds… yeah it works but it takes a while to type up, and often enough I'm too lazy for that. And then I found 'watch' – a utility that comes with most *nix distros. Look at this beauty [man watch]:

watch – execute a program periodically, showing output fullscreen

watch [-dhvt] [-n ] [–differences[=cumulative]] [–help]
[–interval=] [–no-title] [–version]

watch runs command repeatedly, displaying its output (the first screen
This allows you to watch the program output change over time.
By default, …

Read the rest of this article »