List currently logged on users

Patrick Goetz pgoetz at mail.utexas.edu
Fri Sep 12 11:20:52 EDT 2014


Question:  what's wrong with

    ps auxw | grep imap

Doesn't this provide an accurate representation of who's logged in?

On 09/12/2014 10:02 AM, Michel Blanc wrote:
> On 12/09/2014 16:04, Michael Neumann wrote:
>> Hello,
>>
>> i am looking for a command that outputs the currently logged on users of
>> cyrus imapd, is there something available?
>>
>> Best regards
>>
>
> Hello,
>
> I use the following handy one liner :
>
>
> lsof  -p `pidof imapd|tr ' ' ','` | \
> grep '/var/lib/cyrus/user/.*\.seen$' | \
> awk '{ print $9 }' | sort | uniq | \
> cut -f7 -d'/' | cut -f1 -d'.'
>
> with cyrus 2.2 under ubuntu server, YMMV !
>
> Cheers,
>
> M
>


More information about the Info-cyrus mailing list