Where are saved the information given by ifconfig command on raspbian?
I need to read these informations from a file.
Is there any file where (as an example) the mac address of an interface is stored?
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.Sign up to join this community
Raspbian is a Linux based operating system and in Linux most information like the information provided by the
ifconfig command is available in a special file. From this Superuser answer the MAC address is available by reading
$iFACE is a shell variable that contains the interface name desired. Or just by explicitly reading file
/sys/class/net/eth0/addresss for interface
raspberrypi ~ $ cat /sys/class/net/eth0/address b8:27:eb:a3:f9:94