You'll need the who command to get information about where they are logged in from. Who will show the host name, and only the IP address if it cannot translate it. Output looks like this:
The IP/host of that the session is coming from is shown in the last column if it's not local (may differ on non-linux hosts). You'll need to write a script that combines the output from w based on the tty (pts in this case) if you want to display both the "what" and the "where from" information at the same time.
If your script needs to port, be advised that output from who on a FreeBSD system is different -- it has a more consistent output showing all "sources" not just remote ones. Also, the tty listed by w on FreeBSD is a short name p4 rather than ttyp4 where the who command lists the full name.
Hello Experts,
Greeting to all of you.
I have a requirement, that we have a shell script status.sh
that check the status of server and server status shows as status.sh
Enterprise Server - Running
Admin Server - Shutdown
Requirement is like whenever the output shows shutdown it should... (2 Replies)
Hi All,
I am trying to capture the data in linux .While doing load test.
is there's any sample script please help me.
Linux test4 2.6.18-308.8.1.el5 #1 SMP Fri May 4 16:43:02 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
Thanks, (5 Replies)
Hi I want to check if some process is sleeping. I can see that in truss -p <pid>
I want to capture output and check that output if proces sis sleeping. Please suggest way to capture output of truss command or other way to check if process is sleeping (1 Reply)
Unfortunately googling the word 'chat' gives you zebedee billion responses that relate to everything and few of them refer to the linux chat command. I've read the man page and found a couple of examples but can't see how to do this.
I want to query the modem for it's manufacturer, product id... (8 Replies)
Basically what i'm trying to do is execute an update command and at the same time have the system do a TCPdump to file for that update traffic.
So I would like to connect the two commands so that the tcpdump terminates automatically when the update finishes/fails/whatever.
Right now I have... (0 Replies)
&& echo "PLEASE enter the command to capture output" || echo "Processing your command manual"
x=$#
echo $x
while
do
while man $@ | read -r line
do
>$@.txt
... (1 Reply)
function GetInput
{
print -n "Input"
read input
export INPUT=$input
}
export COMMAND="GetInput"
$COMMAND
echo "$INPUT"
$COMMAND | tee -a Log.log
echo "$INPUT"
The first one without "tee" works fine. echo "$INPUT" displays the values I type in for input. The second... (5 Replies)
Some background on what I am trying to accomplish - Accreditation/Certification for DoD (Unix/Linux) system: I am trying to improve the process for capturing key system information in preparation for performing a formal security review of a Unix or Linux system. This is in addition to the SRR... (1 Reply)
I need to determine what processes are running at certain times of the day. I have a script that issues the /usr/ucb/ps aux command and captures it to a file.
I want to see the cpu usage and memory usage.
This command lops off the end of the of the display line so I can't see the entire... (2 Replies)