Sobes.tech
Junior — Middle

How can you determine active network connections established by a specific process in Linux?

sobes.tech AI

Answer from AI

In Linux, to identify active network connections established by a specific process, you can use the ss or netstat command with filtering by PID.

For example, using ss:

ss -tp | grep pid=1234

where 1234 is the process ID.

You can also use lsof to display open network files by the process:

lsof -i -a -p 1234

These commands will show active TCP/UDP connections related to the specified process.