Views: 127
Thank you for reading this post, don't forget to subscribe!
Every once in a while, we Linux administrators want to know if a network cable that’s connected to a Linux box is connected or not without having to physically move the machine and checking the connection and watching to see if the little green light blinks.
Linux has a way for administrators to quickly check the status of the connection via the Terminal. Ā Here’s how:
At the Terminal prompt, type:Ā cat /sys/class/net/enp5s0/carrier
If the output returns with a “1“, then the cable should be connected and talking to the network.
For a more English type of response, enter:Ā cat /sys/class/net/enp5s0/operstate
The output will return by sayingĀ “up”.
That’s it.