#navi(../)
*コマンドの出力をモニタリングする・watchコマンド [#s67bed67]
watch コマンドを利用すれば以下に記すシェルスクリプトと同等のことができます。
- シェルスクリプトで1秒毎にlsコマンドを発行
$ while :
> do
> clear
> ls -l
> sleep 1
> done
#br
#htmlinsertpcsp(linux_ads_top.html,linux-sp.html)
* watchコマンドを利用 [#rf035fe8]
watchコマンドを利用した場合は以下のようになります
watch ls -l
変更された部分をハイライトしたい場合は--differncesまたは-dを指定します。
watch -d ls -l
または
watch --differnces ls -l
変更された部分がハイライトされているスクリーンショット
#ref(watch-01.jpg)
監視間隔を変更する場合は、-nまたは--intervalを指定する。
watch -n 5 ls -l # 5秒ごと出力
または
watch --interval 8 ls -l # 8秒ごとに出力
#br
#htmlinsertpcsp(linux_ads_btm.html,linux-sp.html)
#br