Hi,
it seems `lastcomm' doesn't filter if it gets arguments
or am I reading wrongly man page?
~~~
# lastcomm | grep 'python2.7'
python2.7 -S root ttyp1 0.03 secs Wed
Jan 18 16:32 (0:00:00.06)
# lastcomm python2.7 root ttyp1
grep -S root ttyp1 0.00 secs Wed
Jan 18 16:34 (0:00:00.00)
lastcomm -S root ttyp1 0.00 secs Wed
Jan 18 16:34 (0:00:00.00)
egrep -S root ttyp1 0.00 secs Wed
Jan 18 16:33 (0:00:00.00)
lastcomm -S root ttyp1 0.00 secs Wed
Jan 18 16:33 (0:00:00.00)
grep -S root ttyp1 0.00 secs Wed
Jan 18 16:33 (0:00:00.00)
lastcomm -S root ttyp1 0.00 secs Wed
Jan 18 16:33 (0:00:00.00)
grep -S root ttyp1 0.00 secs Wed
Jan 18 16:33 (0:00:00.00)
lastcomm -S root ttyp1 0.00 secs Wed
Jan 18 16:33 (0:00:00.00)
lastcomm -S root ttyp1 0.00 secs Wed
Jan 18 16:33 (0:00:00.00)
man -S root ttyp1 0.02 secs Wed
Jan 18 16:32 (0:00:22.16)
more -S root ttyp1 0.00 secs Wed
Jan 18 16:32 (0:00:22.12)
lastcomm -S root ttyp1 0.00 secs Wed
Jan 18 16:32 (0:00:00.00)
lastcomm -S root ttyp1 0.00 secs Wed
Jan 18 16:32 (0:00:00.00)
python2.7 -S root ttyp1 0.03 secs Wed
Jan 18 16:32 (0:00:00.06)
accton -S root ttyp1 0.00 secs Wed
Jan 18 16:31 (0:00:00.00)
# sysctl kern.version
kern.version=OpenBSD 6.0-current (GENERIC.MP) #117: Sat Jan 7 09:10:45 MST 2017
[email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
~~~
>From man page:
~~~
If called with arguments, only accounting entries with a matching command
name, user name, or terminal name are printed. So, for example:
lastcomm a.out root ttyd0
would produce a listing of all the executions of commands named a.out by
user root on the terminal ttyd0.
~~~
j.