2026-03-12 20:23:15
This commit is contained in:
18
vdh/cpu_table.sh
Normal file
18
vdh/cpu_table.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
gawk '
|
||||
BEGIN {
|
||||
FS = ":"
|
||||
printf "%5-s %6-s %4-s\n", "OS ID", "Socket", "Core"
|
||||
printf "%5-s %6-s %4-s\n", "-----", "------", "----"
|
||||
}
|
||||
{
|
||||
if ($1 ~ /processor/) {
|
||||
PROC = $2
|
||||
} else if ($1 ~ /physical id/) {
|
||||
PHYID = $2
|
||||
} else if ($1 ~ /core id/) {
|
||||
CID = $2
|
||||
printf "%5s %6s %4s\n", PROC, PHYID, CID
|
||||
}
|
||||
}' /proc/cpuinfo
|
||||
Reference in New Issue
Block a user