Use the below command:
/proc/net/tcp -a list of open tcp sockets
/proc/net/udp -a list of open udp sockets
/proc/net/raw -a list all the 'raw' sockets
These are some files, use the cat command to view them. For example:
cat /proc/net/tcp
You can also use the lsof command.
lsof is the command to open list files, which is used under various Unix-like systems to report your list of all open files and these methods that opened them.
Want to be a Linux expert? Come and join this Linux course
Do check out the video below for better understanding of Linux