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 activity.
See lsof also.
If you found something useful today, please consider a small donation.
Got something to add? Send me email.
By understanding a machine-oriented language, the programmer will tend to use a much more efficient method; it is much closer to reality. (Donald Knuth)