[Bash] watch command

Zhentiw發表於2024-06-07

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

相關文章