Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

lastcomm(1) [opendarwin man page]

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

NAME
lastcomm -- show last commands executed in reverse order SYNOPSIS
lastcomm [-f file] [command ...] [user ...] [terminal ...] DESCRIPTION
lastcomm gives information on previously executed commands. With no arguments, lastcomm prints information about all the commands recorded during the current accounting file's lifetime. Option: -f file Read from file rather than the default accounting file. 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. 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 time used by the process (in seconds). o The time the process started. o The elapsed time of the process. 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, ``C'' indicates the command was run in PDP-11 compatibility mode (VAX only), ``D'' indicates the command termi- nated with the generation of a core file, and ``X'' indicates the command was terminated with a signal. FILES
/var/account/acct Default accounting file. SEE ALSO
last(1), sigaction(2), acct(5), core(5) HISTORY
The lastcomm command appeared in 3.0BSD. 3rd Berkeley Distribution June 6, 1993 3rd Berkeley Distribution

Check Out this Related Man Page

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

NAME
lastcomm -- show last commands executed in reverse order SYNOPSIS
lastcomm [-f file] [command ...] [user ...] [terminal ...] DESCRIPTION
lastcomm gives information on previously executed commands. With no arguments, lastcomm prints information about all the commands recorded during the current accounting file's lifetime. Option: -f file Read from file rather than the default accounting file. 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. 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 time used by the process (in seconds). o The time the process started. o The elapsed time of the process. 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), ``C'' indicates the command was run in PDP-11 compatibility mode (VAX only), ``D'' indicates the command terminated with the generation of a core file, and ``X'' indicates the command was terminated with a signal. FILES
/var/account/acct Default accounting file. SEE ALSO
last(1), sigaction(2), acct(5), core(5) HISTORY
The lastcomm command appeared in 3.0BSD. BSD
December 22, 2006 BSD
Man Page

14 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

to get process start date and time

what is command to get same using ps with switch. I know process id, by specify process id. It should work on solaris and hp-ux I will be happy if for both different commands. (2 Replies)
Discussion started by: naeem ahmad
2 Replies

2. Solaris

I want to know whole day commands executed by particular user

Hi all I want to know the commands executed a by particular user .. for the whole day on my machine. I have checked out with the commad $lastcomm <user> It is throwing an error called: .. /var/adm/pacct: No such file or directory Can u help me in this regard.. Thank U... (3 Replies)
Discussion started by: naree
3 Replies

3. Solaris

whole day commands executed by particular user

Hi all I want to know the commands executed a by particular user .. for the whole day on my machine. I have checked out with the commad $lastcomm <user> It is throwing an error called: .. /var/adm/pacct: No such file or directory Can u help me in this regard.. Thank U Naree (1 Reply)
Discussion started by: naree
1 Replies

4. Solaris

lastcomm output...

Hi I have a user for whom I tried lastcomm command and I get following output, I am wondering about last line..can anyone throw some light what exactly it is doing, pt_chmod S Spiderman pts/14 0.00 secs Fri Sep 5 13:38 bash F Spiderman pts/14 0.00 secs Fri Sep 5... (2 Replies)
Discussion started by: upengan78
2 Replies

5. UNIX for Dummies Questions & Answers

Info about ps command

Hi all, When a process is hung in unix and when we list the process using "ps" command, then does the elapsed timeELAPSED column time display the time elapsed since the process started to the time till the "ps"command was called. Or does the elapsed time column display only the time since the... (4 Replies)
Discussion started by: aixjadoo
4 Replies

6. UNIX for Advanced & Expert Users

The "PS" command was displaying*terminals named as "SYSCON"

Hi, When typing the command ps -fe.the system is showing a process called SYSCON:confused:.... I am not sure what process is that.I hava a script that kills all command staring with 'sys' but i don't want to kill syscon:( since i think it is some system process:confused: .Please help me to find... (1 Reply)
Discussion started by: kiranjose85
1 Replies

7. UNIX for Dummies Questions & Answers

multiple commands to be executed at the same time

how to execute more than one command at the same time in unix .. (4 Replies)
Discussion started by: hemaa
4 Replies

8. Shell Programming and Scripting

which user ran which command

can we come to know all the command ran bya user for last 1 day (1 Reply)
Discussion started by: narang.mohit
1 Replies

9. Solaris

Check executed commands from remote hosts

Hello, Is there any way to check which user and from which IP executed a command to the server.I need something like the history but with information also from which IP the command executed. Thanks in advance (8 Replies)
Discussion started by: @dagio
8 Replies

10. Solaris

accton

I enabled accton and lastcomm can show all users command can restrict specified users, eq. root / user1, users command only? (1 Reply)
Discussion started by: goodbid
1 Replies

11. Shell Programming and Scripting

Finding longest line in a Record

Good Morning/Afternoon All, I am using the nawk utility in korn shell to find the longest field and display that result. My Data is as follows: The cat ran The elephant ran Milly ran too We all ran I have tried nawk '{ if (length($1) > len) len=length($1); print $1}' filename The... (5 Replies)
Discussion started by: SEinT
5 Replies

12. AIX

Alternative command for topas

hi, I need alternative command for topas to check cpu %, i tried with ps but their is lot of diffference between the outputs of two commands... Thanks (3 Replies)
Discussion started by: sumanthupar
3 Replies

13. UNIX for Advanced & Expert Users

Weird output from ps command

Hi Guys, I am regular Solaris user. I came across a weird problem that puzzled me. Hope you guys can help. I found that process's state(command & arguments) in two different variants of ps command is different. Can anyone explain how is this possible? bash-3.2$ ps -eLo pid,s,comm,args |... (2 Replies)
Discussion started by: brij123
2 Replies

14. What is on Your Mind?

Two Forum Discussions with Over 1 Million Views and a Special Badge Award to vgersh99

Working on the new badging system, ran across this by accident: mysql> SELECT views, threadid FROM thread WHERE views > 1000000 ORDER BY views DESC; +---------+----------+ | views | threadid | +---------+----------+ | 2105933 | 20364 | | 1162297 | 37928 | +---------+----------+... (7 Replies)
Discussion started by: Neo
7 Replies