Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to debug a network problem on a embedded system which has a very limited set of userspace applications. Meaning I can't use any of the following

sudo lsof -i
sudo netstat -lptu
sudo netstat -tulpn

How can i read which sockets are binded from /sys or /proc?

share|improve this question

Netstat and lsof get their information from /proc/$pid/fd/* for per-process data and from /proc/net/tcp, /proc/net/udp, /proc/net/icmp and /proc/net/raw for IPv4 socket information (and /proc/net/tcp6, /proc/net/udp6 and /proc/net/raw6 for IPv6). The equivalent of your commands is mostly to read these files in /proc/net (plus DNS lookups).

For debugging purposes, consider uploading a binary of lsof to your system, it can be a lot more convenient than rummaging in /proc.

share|improve this answer

You can get the list of binded sockets from /proc/net/tcp[6], /proc/net/udp[6] and /proc/net/raw[6].

Beware if converting the hex values in those files to "normal" IP adresses, they are in little-endian (e.g. 3900060A represents and not as least significant byte comes first).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.