From ad22c118b7aa28a1afd5e222b1ffd82c9beaee85 Mon Sep 17 00:00:00 2001 From: Shawn Milochik Date: Sat, 25 Jul 2015 15:01:44 -0400 Subject: [PATCH] Added examples of the `watch` command. --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 4a08170..9e51d4c 100644 --- a/README.md +++ b/README.md @@ -447,6 +447,18 @@ A few examples of piecing together commands: - `fortune`, `ddate`, and `sl`: um, well, it depends on whether you consider steam locomotives and Zippy quotations "useful" +- `watch` lets you run a command repeatedly without re-typing it: + +```sh +# Will run every two seconds. The optional +# -d causes it to highlight any changes. +$ watch -d -n 2 'ls -rtlh | tail' + +# Keep an eye on your IP address and data transfer +# while troubleshooting your WiFi connection. +watch -d -n 2 ifconfig +``` + ## MacOS X only