06-05-2008
Help Required: Command to find IP address and command executed of a user
Hi,
I am trying to write a script which would figure out who has run which command and their IP. As i dont have any clue as to which commands would do this job, i request some gurus to help me on this.
Thanks
Vishwas
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I am executing a find command in my script i.e
find $2 -type f -name '*.gif' -mtime +$1 -exec rm {} \;
how do i check that this command is executed properly.. i would lke t trap the errror and display my error message
kinly help.. this is an urgent issue. (1 Reply)
Discussion started by: vijay.amirthraj
1 Replies
2. UNIX for Dummies Questions & Answers
I am trying to determine if there are several url/host names for an IP address. Is there a UNIX command to find ALL host names for an IP address?
Thank you in advance. (3 Replies)
Discussion started by: rukasu
3 Replies
3. Shell Programming and Scripting
Hi everyone,
when executing this command in unix:
echo "WM7 Fatal Alerts:", $(cat query1.txt) > a.csvIt works fine, but running this command in a shell script gives an error saying that there's a syntax error.
here is content of my script:
tdbsrvr$ vi hc.sh
"hc.sh" 22 lines, 509... (4 Replies)
Discussion started by: 4dirk1
4 Replies
4. Shell Programming and Scripting
Hi
I have created a perl script & running it using Linux machine. I want my script to die when system command is unsuccessful but script is dying even when system command gets executed successfully. :wall:
I am using the command below :-
system($cmd) || die "FAILED $!";
print "Hello";
... (2 Replies)
Discussion started by: Priyanka Gupta
2 Replies
5. AIX
In Unix If we executed any command where will generate the particluar log related to command in Unix. (4 Replies)
Discussion started by: victory
4 Replies
6. Shell Programming and Scripting
Hello,
I have written a command n shell script :
srvctl relocate service -d t1 -s s1 -i i1 -t t1 -f
If the above command executes successfully without error I need to echo
"Service relocated successfully
and If it errors out I need to trap the errors in a file and also need to make... (1 Reply)
Discussion started by: Vishal_dba
1 Replies
7. UNIX for Dummies Questions & Answers
Hi Guys,
I like to output every command executed in the script to a file.
I have tried set -x which does the same.
But it is not giving the logs of the child script which is being called from my script.
Is there any parameters in the Set command or someother way where i can see the log... (2 Replies)
Discussion started by: mac4rfree
2 Replies
8. SuSE
Hi,
I am using below code snippet to echo/display the files found
(matching a pattern from searchstring.out file) and the corresponding owner.
while read j
do
echo "Pattern to search is:- $j"
find / -name "*$j*" |\
while read k
do
echo "File found is:- $k"
owner=$(ls... (9 Replies)
Discussion started by: Vipin Batra
9 Replies
9. UNIX for Beginners Questions & Answers
Hi Team,
Please help me with the below question.
SunOS 5.10
Shell: -bash
I am trying to find the original user who executed a command on my development server.
In my dev server users login using their personal id and sudo to a common id using 'sudo -u commonid -i'. Once logged in as... (6 Replies)
Discussion started by: sam99
6 Replies
10. UNIX for Beginners Questions & Answers
hi~~
my Os is 6.1
i want to find heartbeat ip address from below result.
i think, is it en7 onto both nodes?
/usr/es/sbin/cluster/utilities/cllsif
Adapter Type Network Net Type Attribute Node IP Address Hardware Address Interface Name Global Name ... (2 Replies)
Discussion started by: tomato00
2 Replies
LEARN ABOUT OSF1
lastcomm
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)