python中,獲取設備網卡接口(ethx, mgmt)

ls -l /sys/class/net/ | grep -v virtual | sed '1d' | awk 'BEGIN {FS="/"} {print $NF}' 命令在linux系統執行後,獲取結果以下(系統不一樣,結果不一樣) 在python中,想要獲取linux設備網卡接口,並用列表進行保存python def get_eth(): eth_list = [] os.
相關文章
相關標籤/搜索