# Finding the IP from the PID

Right now, I'm able to get the PID of a process from:

ps aux|grep processname


How can I get the Port no/IP of the process? There's lsof and fuser for Port to PID but is there another way to get the port from the PID? I've already posted this on stackoverflow but thought that this forum would be more appropriate. Also i couldn't migrate the question by myself. Sorry for cross posting.

-

netstat -a -p