Repeatedly execute a bash command and observe its output

Posted . Visible to the public.

You can have a command repeatedly executed and the output displayed. This is useful e.g. for monitoring file system changes with ls, but has many more applications.
The update frequency is controlled by the -n argument (default: 2s), which is locale-specific; i.e. you might need to use a comma as delimiter.

  > watch -n 1.5 ls
Profile picture of Dominik Schöler
Dominik Schöler
Last edit
Henning Koch
License
Source code in this card is licensed under the MIT License.
Posted by Dominik Schöler to makandra dev (2016-10-25 11:15)