TCP/IP and NFS FAQ
By using lsof (included with Linux, available from Skunkware for old SCO).
For example, if you wanted to know what process is using port
139, you'd do:
lsof -i :139
The lsof tool is not just for network connections. It shows you
detailed information about open files in general- not just network
See lsof also.