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.
About Post Author
(Visited 27 times, 1 visits today)