4 Years
Discussion Span
Last Post by L7Sqr

You may be able to combine the output of w or who - both list the TTY and connection - with the output of ps (which shows the TTY) to figure out which bash process is yours.

EDIT: Looks like bash has a built-in variable for just this purpose: $$ contains the current process ID.

Edited by L7Sqr


Is there any way to get the IP of user( machine ) and corresponding Process ID, without admin rights.


To get the ip of the machine (there may be multiple) you can use ifconfig. Sometimes that wont reside in your $PATH so you will need to provide an absolute path with the name like: /usr/sbin/ifconfg

What do you want the process ID of? I gave you the answer above for the currently running process ($$). Is there another process you are interested in?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.