查看显卡的命令 client.exec_command(r"""lspci -nD | sed 's/\(.*\ .*\): \([0-9a-z]\{,4\}:[0-9a-z]\{,4\}\)\(.*\)/\1 \2/g' | awk '{if ($2 ~ "^(01).*" && $3 ~ "^(1234|5678).*") print $0}'""") 根据自己的需求进行定制,前面加r转义,多引号将单引号和双引号包起来。