WITHOUT using network command lines in linux, how to know list of open ports and the process that owns them?
You should be able to find all open ports in /proc/net/tcp
and /proc/net/udp
. Each of those files have an inode
column, which can be used to find the process owning that socket.
Once you have an inode number, you can run an ls command such as ls -l /proc/*/fd/* | grep socket:.$INODE
to find the processes using that socket. In case a process has been set up with different file descriptors for different threads, you may need to extend the command to ls -l /proc/*/task/*/fd/* | grep socket:.$INODE
in order to find them all.