Monitor state using the watch command

Quite often as a developer, I need to monitor the state of something. Whether it be a list of files, the state of a process or the output of a command, it’s very useful to be able to do this easily.

Enter the watch command.

Just install with homebrew and you’re ready to roll.

$ brew install watch
$ watch -h

I’m using this to great effect to monitor the state of local Docker containers and volumes. Something like this works a treat:

$ docker ps --all --filter name=blog && echo && docker volume ls --filter name=blog

You should then get this kinda thing:

1__monitor_sh__sh_

Hope that helps.

Advertisements

One thought on “Monitor state using the watch command

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s