lastcomm (1) Linux Manual Page
NAME
lastcomm – print out information about previously executed commands.
SYNOPSIS
lastcomm- [ command-name … ]
[ user-name … ]
[ terminal-name … ]
[ OPTION … ]
DESCRIPTION
lastcomm prints out information about previously executed commands. If no arguments are specified, lastcomm will print info about all of the commands in acct (the record file). If called with one or more of command-name, user-name, or terminal-name, only records containing those items will be displayed. For example, to find out which users used command `a.out’ and which users were logged into `tty0′, type:
This will print any entry for which `a.out’ or `tty0′ matches in any of the record’s fields (command, name, or terminal). If you want to find only items that match *all* of the arguments on the command line, you must use the ‘-strict-match’ option. For example, to list all of the executions of command a.out by user root on terminal tty0, type:
The order of the arguments is not important.
For each entry the following information is printed:
+
+
+
+
OPTIONS
–strict-match- Print only entries that match *all* of the arguments on the command line.
–print-controls- Print control characters.
–username- List records for user with name. This is useful if you’re trying to match a username that happens to be the same as a command (e.g., ed ).
–commandname- List records for command name.
–ttyname- List records for tty name.
–forwards- Read file forwards instead of backwards. This avoids trying to seek on the file and can be used to read from a pipe. This must be specified prior to any
-farguments. -ffilename,–filefilename- Read from the file filename instead of acct. A filename of "-" will result in reading from stdin. This must either be the first
-foption, or–forwardsmust precede all-foptions. –ahzhz- Use this flag to tell the program what
AHZshould be (in hertz). This option is useful if you are trying to view an acct file created on another machine which has the same byte order and file format as your current machine, but has a different value forAHZ. -p, –show-paging- Print paging statistics.
–pid- Show PID and PPID of the process if acct version 3 format is supported by kernel.
–debug- Print verbose internal information.
-V, –version- Print the version number of
lastcomm. -h, –help- Prints the usage string and default locations of system files to standard output and exits.
FILES
acct
- The system wide process accounting file. See
acct(5) (orpacct(5)) for further details. /var/log/account- This directory contains pacct files which contain the binary process accounting data as written by the kernel.
AUTHOR
The GNU accounting utilities were written by Noel Cragg <noel [at] gnu.ai.mit.edu>. The man page was adapted from the accounting texinfo page by Susan Kleinmann <sgk [at] sgk.tiac.net>.
