Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

lastcomm(1) [redhat man page]

LASTCOMM(1)						      General Commands Manual						       LASTCOMM(1)

NAME
lastcomm - print out information about previously executed commands. SYNOPSIS
lastcomm [ command-name ... ] [ user-name ... ] [ terminal-name ... ] [ --strict-match ] [ -f filename | --file filename ] [ --user name ] [ --command name ] [ --tty name ] [ --debug ] [ -V | --version ] [ -h | --help ] 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: lastcomm a.out tty0 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: lastcomm --strict-match a.out root tty0 The order of the arguments is not important. For each entry the following information is printed: + command name of the process + flags, as recorded by the system accounting routines: S -- command executed by super-user F -- command executed after a fork but without a following exec C -- command run in PDP-11 compatibility mode (VAX only) D -- command terminated with the generation of a core file X -- command was terminated with the signal SIGTERM + the name of the user who ran the process + time the process exited OPTIONS
--strict-match Print only entries that match *all* of the arguments on the command line. --user name 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 ). --command name List records for command name. --tty name List records for tty name. -f filename, --file filename Read from the file filename instead of acct --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) (or pacct(5)) for further details. AUTHOR
The GNU accounting utilities were written by Noel Cragg <noel@gnu.ai.mit.edu>. The man page was adapted from the accounting texinfo page by Susan Kleinmann <sgk@sgk.tiac.net>. SEE ALSO
last(1), acct(5) 1995 October 31 LASTCOMM(1)

Check Out this Related 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.10 10 Jan 2000 lastcomm(1)
Man Page