Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

lastcomm(1) [opensolaris man page]

lastcomm(1)							   User Commands						       lastcomm(1)

NAME
lastcomm - display the last commands executed, in reverse order SYNOPSIS
lastcomm [-f file] [-x] [command-name] ... [user-name] ... [terminal-name] ... DESCRIPTION
The lastcomm command gives information on previously executed commands. lastcomm with no arguments displays information about all the com- mands recorded during the current accounting file's lifetime. If called with arguments, lastcomm only displays accounting entries with a matching command-name, user-name, or terminal-name. If extended process accounting is active (see acctadm(1M)) and is recording the appro- priate data items, lastcomm attempts to take data from the current extended process accounting file. If standard process accounting is active, lastcomm takes data from the current standard accounting file (see acct(2)). If terminal-name is `- -', there was no controlling TTY for the process. The process was probably executed during boot time. If terminal- name is `??', the controlling TTY could not be decoded into a printable name. For each process entry, lastcomm displays the following items of information: o The command name under which the process was called. o One or more flags indicating special information about the process. The flags have the following meanings: F The process performed a fork but not an exec. S The process ran as a set-user-id program. o The name of the user who ran the process. o The terminal which the user was logged in on at the time (if applicable). o The amount of CPU time used by the process (in seconds). o The date and time the process exited. OPTIONS
The following options are supported: -f file Uses file as the source of accounting data. file may be either an extended process accounting file or a standard process accounting file. -x Uses the currently active extended process accounting file. If extended processing accounting is inactive, no output will be produced. EXAMPLES
Example 1 Listing executions of named commands The command example% lastcomm a.out root term/01 produces a listing of all the executions of commands named a.out by user root while using the terminal term/01. Example 2 Listing all user commands The command example% lastcomm root produces a listing of all the commands executed by user root. FILES
/var/adm/pacct standard accounting file /var/adm/exacct/proc extended accounting file ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWesu | +-----------------------------+-----------------------------+ SEE ALSO
last(1), acctadm(1M), acct(2), acct.h(3HEAD), sigvec(3UCB), core(4), attributes(5) SunOS 5.11 10 Jan 2000 lastcomm(1)

Check Out this Related Man Page

LASTCOMM(1)						    BSD General Commands Manual 					       LASTCOMM(1)

NAME
lastcomm -- show last commands executed SYNOPSIS
lastcomm [-EScesu] [-f file] [+format] [command ...] [user ...] [terminal ...] DESCRIPTION
The lastcomm utility gives information on previously executed commands. With no arguments, lastcomm prints information about all the com- mands recorded during the current accounting file's lifetime. The following options are available: -E Print the time the process exited. -S Print the time the process started. -c Print the amount of cpu time used by the process. -e Print the amount of elapsed time used by the process. -s Print the amount of system time used by the process. -u Print the amount of user time used by the process. -f file Read from file rather than the default /var/account/acct. If file is a single dash ('-') lastcomm reads accounting entries from the standard input. An operand with a leading plus sign ('+') is followed a user-defined format string which specifies the format in which to display the process's start or exit date and time. The format string may contain any of the conversion specifications described in the strftime(3) man- ual page, as well as arbitrary text. If no options are specified, -cS is assumed. If lastcomm is invoked with arguments, only accounting entries with a matching command name, user name, or terminal name are printed. 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. For each process entry, the following are printed. o The name of the user who ran the process. o Flags, as accumulated by the accounting facilities in the system. o The command name under which the process was called. o The amount of CPU (-c), wall (-e), system (-s), or user (-u) time used by the process (in seconds). o The time the process started (-S) or exited (-E). The flags are encoded as follows: ``S'' indicates the command was executed by the super-user, ``F'' indicates the command ran after a fork, but without a following exec(3), ``D'' indicates the command terminated with the generation of a core file, and ``X'' indicates the command was terminated with a signal. By default, accounting entries are printed going backwards in time, starting from the time lastcomm was executed. However, if lastcomm reads entries from its standard input, then entries are printed in the order they are read. FILES
/var/account/acct default accounting file EXAMPLES
The command lastcomm -Ee will print the exit time and elapsed time of each command logged in /var/account/acct, while tail -f -c 0 /var/account/acct | lastcomm -f - will print details of each terminating command. SEE ALSO
last(1), sigaction(2), strftime(3), acct(5), core(5) HISTORY
The lastcomm command appeared in 3.0BSD. BSD
May 17, 2012 BSD
Man Page