zoukankan      html  css  js  c++  java
  • liunx下判断有线网口硬件是否正常的三个常用方式

    第一种,命令法:

    /mnt/wifi$ cat /proc/net/dev

    Inter-|  Receive                                                | Transmit

    face |bytes  packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carriercompressed

    lo:      0      0    0  0    0    0        0        0        0      0    0    0  0    0      0        0

    eth0:    3439    15  0  0    0    0        0        0        0      0    0    0  0    0      0          0

    第二种:dmesg查看日志法,link down是表示拔出网线,link up表示是连接网线。

    [110312.799679] r8169 0000:02:00.0 enp2s0: link down
    [110347.642299] r8169 0000:02:00.0 enp2s0: link up

      

    第三种: ifconfig 查看状态方法。查看红色关键字。

    插网线:
    /mnt/wifi$ ifconfig eth0
    eth0      Link encap:Ethernet  HWaddr 06:ED:B5:C3:AA:23
    UP BROADCAST RUNNING MULTICAST  MTU:1500 Metric:1
    RX packets:159 errors:0 dropped:0overruns:0 frame:0
    TX packets:0 errors:0 dropped:0overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:23822 (23.2 KiB)  TX bytes:0 (0.0 B)
    Interrupt:14
    拔网线:
    /mnt/wifi$ ifconfig eth0
    eth0      Link encap:Ethernet  HWaddr 06:ED:B5:C3:AA:23
    UP BROADCAST MULTICAST  MTU:1500 Metric:1
    RX packets:160 errors:0 dropped:0overruns:0 frame:0
    TX packets:0 errors:0 dropped:0overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:24055 (23.4 KiB)  TX bytes:0 (0.0 B)
    Interrupt:14

    除了这三种简单的,还有其它的代码方式,这个后面有空再研究吧。

  • 相关阅读:
    JS 做的鼠标放大镜(初级)
    用JS做关灯游戏(初级)
    JS 做时钟
    Magic Powder
    (记忆化搜索)Jury Compromise (poj 1015)
    (求凹包) Bicycle Race (CF 659D) 简单题
    Phalanx (hdu 2859)
    第十四个目标 (fzu)
    (树形dp)鸡毛信问题 (fzu 1227)
    (最大m子段和) Max Sum Plus Plus (Hdu 1024)
  • 原文地址:https://www.cnblogs.com/dylancao/p/8366478.html
Copyright © 2011-2022 走看看