我正在编写一个程序,在那里我需要了解机器的配置。代码将在Linux上运行。我想找到以下几点:
Linux是否在我可以读取的文件中公开这些信息以获取这些信息?
有什么好的资源可以阅读这样的linux内部呢?
发布于 2015-02-13 23:46:34
Does Linux expose this information in some file that I can read in to get this information?
1. Number of CPU Cores
2. Number of CPU Sockets
3. Number of Disks
4. If it's a 4 socket processor then which 2 sockets are adjacent to each other是的,关于CPUs和Disks的信息可以在Linux中获得。
/proc/cpuinfo包含有关CPU的详细信息。
e.g. cat /proc/cpuinfo命令sudo fdisk -l提供了磁盘及其相关信息的列表。
这个链接提供了一些关于/proc/cpuinfo的细节。
这个链接解释了sudo fdisk -l的使用和输出。
https://unix.stackexchange.com/questions/184768
复制相似问题