lastcomm(1) General Commands Manual lastcomm(1)Name
lastcomm - show last commands executed in reverse order
Syntax
lastcomm [command name...] [user name...] [terminal name...]
Description
The command gives information on previously executed commands. With no arguments, prints information about all the commands recorded dur-
ing the current accounting file's lifetime. If called with arguments, only accounting entries with a matching command name, user name, or
terminal name are printed. The following example produces a listing of all the executions of commands named by user root on the terminal
ttyd0:
lastcomm a.out root ttyd0
For each process entry, the following are printed:
The name of the user who ran the process.
Flags, as accumulated by the accounting facilities in the system.
The command name under which the process was called.
The amount of cpu time used by the process (in seconds).
The time the process exited.
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 terminated with the generation of a core file
``X'' indicates the command was terminated with the signal SIGTERM
See Alsolast(1), sigvec(2), acct(5), core(5)lastcomm(1)
Check Out this Related Man Page
lastcomm(1) General Commands Manual lastcomm(1)NAME
lastcomm - show last commands executed in reverse order
SYNOPSIS
[commandname] ... [username] ... [terminalname] ...
DESCRIPTION
gives information on previously executed commands. If no arguments are specified, prints information about all the commands recorded in
the accounting file, during the current accounting file's lifetime. If called with arguments, only accounting entries with a matching com-
mand name, user name, or terminal name are printed. For example, to produce a listing of all executions of commands named by user on ter-
minal use:
For each process entry, the following are printed.
o Name of the user who ran the process.
o Flags, as accumulated by the accounting facilities in the system.
o Command name under which the process was called.
o Amount of cpu time used by the process (in seconds).
o What time the process started.
Flags are encoded as follows:
Command was executed by a user who has appropriate privileges.
Command ran after a fork, but without a following
exec.
Command terminated with the generation of a
file.
Command was terminated with the signal
SIGTERM.
AUTHOR
was developed by the University of California, Berkeley.
FILES
current file for per-process accounting
SEE ALSO last(1), acct(4), acctsh(1M), core(4).
lastcomm(1)
Hello Unix Champs,
For keeping audit trail, I want to log the commands entered by the normal users, on their terminal into a text file.
I tried putting a "script -a username.timestamp.txt" in the user profile file, but script command stops execution when user types exit or presses CTRL+D... (3 Replies)
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)
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)
Dears,
how to determine the commands that could be used by certain user..like I want to prevent some users from running pwd command????
Thanx (4 Replies)
Can any one help me with a script, which runs in background and mails me all the commands entered by root on any terminal for every hour. We have multiple people having root access on the server and creating a mess,i just wanted to monitor all the activity of the root. (13 Replies)
Hi All,
Is there a way to check command executed by users in Linux for a specific date? I know we can use history, but it doesn't shows yesterday's executed commands.
rgds, (3 Replies)
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)
When I ran the following find command under a "regular" user is completes but it limited because of perms.
find / -name "*.*" | xargs grep something > ok
But when I try to run it under su, it hangs and never completes.
Any suggestion? (4 Replies)
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)
is it possible that we can restrict the root user if he runs some commands?? e.g i want if root runs command 'rm etc/passwd', he shoudn't be able to run command and throws error :confused: (3 Replies)
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)
I'm working with unix AIX core May 3 00F80B654C00 I use putty as terminal have a given every time I write a command is not in memory if I want to use I have to rewrite as I can do to that command me to stay saved so that riva press the arrow and have the command history (4 Replies)
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)
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)