一 hostname:显示和设置系统主机的名。
(1)选项:
*-a:显示主机的别名。
*-i:显示指定主机的ID地址。
二 uname:print system information。
*-a:print all information.
*-s:print kernel name.
*-v:print the kernel version.
三 综合:
(1)打印出CPU相关信息:
cat /proc/cpuinfo
第五行为cpu的名称:cat /proc/cpuinfo | head -n 5 | tail -1
(2)打印内存的详细信息:
cat /proc/meminfo
(3)打印系统分区信息:
cat /proc/partitions
或fdisk命令。
(4)获取系统的详细信息:
lshw:lshw is a small tool to extract detailed information on the hardware configuration of the machine.