List network devices
You are probably familiar with the ifconfig command, that command is already deprecated in modern Linux distributions, see below the new way, the new command you can use get a list of the network interfaces and their current state (UP/DOWN).
ip link show
ip link show | grep state
ip link show | grep "state UP"
ip link show | grep "state DOWN"