posts - 81,comments - 59,trackbacks - 0

Windows

wmic bios get serialnumber

Mac OS X

ioreg -l | grep IOPlatformSerialNumber

Linux

sudo dmidecode -t system | grep Serial

tips:
注意当需要后面跟grep时,在操作代码时需要注意以下:


      String[] cmd = {"/bin/sh", "-c", "ioreg -l | grep IOPlatformSerialNumber"};
      String rst = RuntimeUtil.execForStr(cmd);

posted on 2020-08-08 23:00  聂晨  阅读(41)  评论(0编辑  收藏