Here are some usage examples.

The syntax can seem a little bit tricky, but it largely follows the
`find' command syntax conventions.


List currently logged in people:
$ ulog

Detailled view of currently logged in people:
$ ulog -ls

Is user `rv' currently logged in?
$ ulog -u rv

Display which members of the group `admin' are currently logged in:
$ ulog -g admin

See who is currently logged in on host `star':
$ ulog -h star

See who is currently logged in on displays `dark' and `star:0':
$ ulog -d 'dark:*,star:0'
 or
$ ulog -d 'dark:*' -o -d star:0

See who is currently logged in on non ':0' displays:
$ ulog ! -d '*:0'

See who has been logged for more than 2 days on host `star':
$ ulog -itime +2 -h star

See who has been logged for less than 1 hour:
$ ulog -imin -60

Real-time mode:
$ ulog -f

Interactive mode:
$ ulog -i

History mode:
$ ulog -A

To be warned with a bip ("\a") in real-time when someone logs in/out:
$ ulog -f -printf '%l of user %u on host %h (display %d) at %t\a\n'

Invite everyone currently logged in to a pizzeria:
$ echo 'Pizza?' | mail -s food $(ulog -printf "%u ")

See who was the last logged in (and still currently logged in):
$ ulog --sort=-date | head -1
 or
$ ulog --sort=date | tail -1


See manpages for full command line option description.

-- 

 Hervé Eychenne