Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

lastcomm(8) [osf1 man page]

lastcomm(8)						      System Manager's Manual						       lastcomm(8)

NAME
lastcomm - Outputs information about the last commands executed SYNOPSIS
lastcomm [Command] [Name] [Tty] DESCRIPTION
The lastcomm command outputs information about all previously executed commands that are recorded in the /var/adm/pacct file in reverse chronological order. You may specify a particular command with the Command parameter, a particular user with the Name parameter, and a particular terminal as the command source with the Tty parameter. Output is then restricted to the specified parameters. A Tty terminal may be named fully (for example, tty0) or abbreviated (for example, 0). The following information is displayed for each process: Name of the command under which the process was called. Any flags collected when the command was executed. The following flags are valid: Command was run with an effective user-id of 0. Command ran after a fork, but without an exec system call following it. Name of the user who issued the command. The terminal the command was started from. Seconds of CPU time used. Time the process started. EXAMPLES
To display information about all previously executed commands recorded in the /var/adm/pacct file, enter: lastcomm Information is displayed similar to: lastcomm ajh lat/620 1.13 secs Thu Feb 24 15:02 pg ajh lat/620 5.91 secs Thu Feb 24 15:01 ln miller ttyp1 1.14 secs Thu Feb 24 15:01 ls rob ttyp1 0.02 secs Thu Feb 24 15:01 pg sjz ttyp1 0.33 secs Thu Feb 24 15:00 sendmail SF root __ 0.01 secs Thu Feb 24 15:00 To display information about commands named a.out executed by the root user on terminal ttyd0, enter: lastcomm a.out root ttyd0 FILES
Specifies the command path. The current accounting file. RELATED INFORMATION
Commands: last(8) delim off lastcomm(8)

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

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

path

if i give path command output like this how to edit path file where it resides. $PATH bash: /opt/terascan/pass/postprocs:/opt/terascan/bin:/opt/terascan/pgs/bin:/opt/terascan/batch/bin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/teradm/bin: No such file or directory (18 Replies)
Discussion started by: rajan_ka1
18 Replies

2. UNIX for Dummies Questions & Answers

find command

Hi all., i am using the follwowing command.. ls -ltr TNT.*.*.*.ctl* | awk -F" " '{print $6" "$7 }' the output is: Feb 27 Feb 27 Feb 27 Feb 27 Feb 28 Feb 28 Mar 9 Mar 21 Mar 21 from this output i am trying to get the FIND the files on march 21. i am using the find command no... (6 Replies)
Discussion started by: pavan_test
6 Replies

3. UNIX for Dummies Questions & Answers

CUT Command

Hi, Can anyone tell me if I can apply multiple cut on a single variable like below in a sh script: tmp=`cut -c 1-4 $val` tmp1=`cut -c 5-12 $val` tmp2=`cut -c 13-18 $val` If not, what is the other way to do this. Thanks and Best Regards Shoeb (17 Replies)
Discussion started by: shoeb_syed
17 Replies

4. UNIX for Dummies Questions & Answers

Command similar to doskey

Hello all, I need a help in unix. is there any command in unix similar to doskey in MS Dos. It taked pain to enter the big command again and again.. the up and down arrows do not bring the previous commands on the prompt. so pls let me know if there is any command to enable the doskey kind of... (4 Replies)
Discussion started by: halel
4 Replies

5. UNIX for Advanced & Expert Users

Capture of all commands issued by the user “root”

I have to write a script (not C based) that allows to capture of all commands issued by the user “root”. First, I tried to monitor the .bash_history but the commands are written in chunk after the .bash_history is closed. How can I capture the commands in Real-Time without waiting root to... (4 Replies)
Discussion started by: elieifrah@gmail
4 Replies

6. Shell Programming and Scripting

sort output

this one is a bit tricky: host16 /etc/passwd changed Thu Jan 3 16:39:48 host3 /etc/group changed Thu Jan 3 16:39:48 host2 /etc/services changed Thu Jan 3 16:39:48 host10 /etc/group changed Thu Jan 10 09:59:01 host11 /etc/group changed Thu Jan 3 18:55:38 host17 /etc/group changed Thu Jan... (9 Replies)
Discussion started by: funksen
9 Replies

7. UNIX for Dummies Questions & Answers

Command to run multiple commands from a file.

I need a command, which could run mutliple commands from a file. Let's say, I have mv fileA1 fileB1 mv fileA2 fileB2 ..... mv fileA20 fileB20 I put these commands in a file, then I need a command to run the file as a whole so that I don't need to type 20 times... Anyone tell me how to... (8 Replies)
Discussion started by: kaixinsjtu
8 Replies

8. Shell Programming and Scripting

How to distinguish between "command not found" and "command with no result"

system() call imeplemented in solaris is such a way that: Command not found - return code 1 Command executed successfully without Output - return code 1 how to distinguish between these two based on return code in a c - file? Can you help on this ? (5 Replies)
Discussion started by: iitmadhu
5 Replies

9. Red Hat

rhn_register A socket error occurred

All, I'm getting the following error while I try to register the server to connect the redhat network for the updates. rhn_register updateLoginInfo() login info rhn_register A socket error occurred: (111, 'Connection refused'), attempt #1 rhn_register A socket error occurred: (111,... (6 Replies)
Discussion started by: s_linux
6 Replies

10. 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

11. Shell Programming and Scripting

File Format Help

I run a command,(EMC Celerra replication status), and it prints in specific format. I would like to re-format to read better. Any help is appreciated. FROM: Name = Job1 Last Sync Time = Mon Aug 22 16:38:32 EDT 2011 Name =... (9 Replies)
Discussion started by: linuxaddict7
9 Replies

12. AIX

AIX Shutdown Investigation

AIX error log (read with the errpt command) /var/adm/wtmp account file (read with the last command) /var/adm/pacct account files (read with the lastcomm command) AIX console log (read with the alog -t console -o command) su log file (read with cat /var/adm/sulog) Shell history file (read... (4 Replies)
Discussion started by: prpkrk
4 Replies

13. Shell Programming and Scripting

i need help to find the error in the unix code

i need help i am facing a problem, with this code and i dont know what is it , i need to check how many parameter the user enter and what was the first parameter if the user enter 4 parameter i have to check if the first parameter equal to 1 or 3 if its not equal i have to exit . and i have to... (5 Replies)
Discussion started by: bader_kwt
5 Replies

14. UNIX for Dummies Questions & Answers

[Solved] Finger command

Hi, I am writing script to take last logon user id detials by using finger command. But I am getting below output. wer34 Feb 10:23 I NEED to display wer34 Feb 10 2013 10:23, Is there any way to get like this. (18 Replies)
Discussion started by: stew
18 Replies

15. UNIX for Dummies Questions & Answers

List commands executed on a server

Hi All, how to list all the commands executed by users on a linux server.... I dont have access to others .bash_history. and i am not root user.. Please help.. Thanks in advance.. (6 Replies)
Discussion started by: nanz143
6 Replies