while loop

while command
do
commands
done

while command; do commands; done

For example:

[alice@localhost sandbox]$ while true
> do
>   sleep 2
>   date
> done
Tue Dec  5 14:54:55 MST 2017
Tue Dec  5 14:54:57 MST 2017
Tue Dec  5 14:54:59 MST 2017
^C
[alice@localhost sandbox]$

Here is another example (that checks every 2 seconds how many times a user is logged in on the onyx server):

[alice@onyx ~]$ while true
> do
>   sleep 2
>   who | grep amit | wc -l
> done
1
1
1
^C
[alice@onyx ~]$