[Bash] watch command

watch

For example every 5 second, I want to print out the time then save the time into the a txt file

$watch -n5 'echo `date +%T` >> hello.txt'

# then you can see the output by using

$ tail -f hello.txt
posted @ 2024-06-07 20:58  Zhentiw  阅读(6)  评论(0编辑  收藏  举报