You can use “watch” command which execute a program periodically.
$ watch -n 3 "date; ls | wc -l"
Also you can use “yes” command which basically outputs a string repeatedly until killed.
$ yes "date;ls |wc -l; sleep 3" | sh
And if you are interested in writing a BASH one liner, here it is using while.
$ while :
> do
> date
> ls |wc -l
> sleep 3
> done
* while : #same as while true,
No comments:
Post a Comment