简体   繁体   English

使用终端在OSx上获取主HDD串行

[英]Getting Primary HDD serial on OSx using terminal

Ok, so I think the title of this question pretty much sums it up. 好的,所以我认为这个问题的标题几乎可以概括一下。

I would to know of a way to obtain the serial number of the HDD that the operating system is installed on, in OSx without having Admin privileges. 我想知道一种在没有管理员特权的情况下在OSx中获取安装操作系统的HDD序列号的方法。 Preferably, I would like to do this using Terminal because I need to use the serial in my Java application and I doubt Java has the capabilities to obtain the information itself. 最好是,我想使用Terminal来执行此操作,因为我需要在Java应用程序中使用序列号,并且我怀疑Java是否具有获取信息本身的功能。

Thanks in advance 提前致谢

/usr/sbin/diskutil info / | /usr/bin/awk '$0 ~ /UUID/ { print $3 }'

那应该给您安装在根目录下的驱动器的序列号。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM