1:uname
$ uname --helpUsage: uname [OPTION]...Print certain system information. With no OPTION, same as -s. -a, --all print all information, in the following order, except omit -p and -i if unknown: -s, --kernel-name print the kernel name -n, --nodename print the network node hostname -r, --kernel-release print the kernel release -v, --kernel-version print the kernel version -m, --machine print the machine hardware name -p, --processor print the processor type or "unknown" -i, --hardware-platform print the hardware platform or "unknown" -o, --operating-system print the operating system --help display this help and exit --version output version information and exitGNU coreutils online help: <http://www.gnu.org/software/coreutils/>For complete documentation, run: info coreutils 'uname invocation'
罕用
# 显示所有$ uname -a # 硬件平台$ uname -i x86_64# 内核版本号$ uname -r3.10.0-229.el7.x86_64$ uname -v#1 SMP Fri Mar 6 11:36:42 UTC 2015
2:/proc/version
零碎运行内核版本号以及gcc版本号
$ cat /proc/version Linux version 3.10.0-229.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC) ) #1 SMP Fri Mar 6 11:36:42 UTC 2015
3:/proc/cpuinfo
cpu 相干信息
$ cat /proc/cpuinfo processor : 0vendor_id : GenuineIntelcpu family : 6model : 94model name : Intel(R) Core(TM) i5-6400 CPU @ 2.70GHzstepping : 3cpu MHz : 2711.952cache size : 6144 KBphysical id : 0siblings : 1core id : 0cpu cores : 1apicid : 0initial apicid : 0fpu : yesfpu_exception : yescpuid level : 22wp : yesflags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc pni pclmulqdq monitor ssse3 cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx rdrand lahf_lm abm 3dnowprefetch fsgsbase avx2 invpcid rdseedbogomips : 5423.90clflush size : 64cache_alignment : 64address sizes : 39 bits physical, 48 bits virtualpower management:
常见命令
# 查看物理cpu个数$ cat /proc/cpuinfo| grep "physical id" |sort | uniq | wc -l4
# 查看每个物理cpu的核数$ cat /proc/cpuinfo| grep "cpu cores"| uniqcpu cores : 1
# 查看逻辑cpu个数$ cat /proc/cpuinfo| grep "processor"| wc -l4
4: lscpu
Display information about the CPU architecture.
lscpu从sysfs和/proc/cpuinfo收集cpu体系结构信息,命令的输入比拟易读
$ lscpu Architecture: x86_64CPU op-mode(s): 32-bit, 64-bitByte Order: Little EndianCPU(s): 1On-line CPU(s) list: 0Thread(s) per core: 1Core(s) per socket: 1Socket(s): 1NUMA node(s): 1Vendor ID: GenuineIntelCPU family: 6Model: 94Model name: Intel(R) Core(TM) i5-6400 CPU @ 2.70GHzStepping: 3CPU MHz: 2711.952BogoMIPS: 5423.90Hypervisor vendor: OracleVirtualization type: fullL1d cache: 32KL1i cache: 32KL2 cache: 256KL3 cache: 6144KNUMA node0 CPU(s): 0Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc pni pclmulqdq monitor ssse3 cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx rdrand lahf_lm abm 3dnowprefetch fsgsbase avx2 invpcid rdseed
5: /proc/meminfo
零碎内存应用情况
free和vmstat等命令返回数据均来自该文件
具体介绍 参考这里
6: free
Display amount of free and used memory in the system
$ free -h total used free shared buff/cache availableMem: 3.7G 119M 3.3G 8.5M 296M 3.4GSwap: 2.0G 0B 2.0G
7:/proc/uptime 和 /proc/loadavg
零碎运行工夫和空间工夫 单位s
(闲暇工夫可能会是运行工夫的几倍 因为闲暇工夫是所有逻辑cpu的闲暇工夫和)
$cat /proc/uptime 70642.00 282514.43
$ cat /proc/loadavg 0.00 0.01 0.05 1/170 15387
8:uptime
$ uptime 15:22:35 up 19:41, 1 user, load average: 0.00, 0.01, 0.05
别离示意
- 以后工夫 15:22:35
- 零碎曾经运行工夫 19:41 19小时41分
- 以后在线用户数 1个用户
- 零碎负载 1分钟 5分钟 15分钟平均值
9:查看零碎发行版
/etc/os-release
$ cat /etc/os-releaseNAME="CentOS Linux"VERSION="7 (Core)"ID="centos"ID_LIKE="rhel fedora"VERSION_ID="7"PRETTY_NAME="CentOS Linux 7 (Core)"ANSI_COLOR="0;31"CPE_NAME="cpe:/o:centos:centos:7"HOME_URL="https://www.centos.org/"BUG_REPORT_URL="https://bugs.centos.org/"CENTOS_MANTISBT_PROJECT="CentOS-7"CENTOS_MANTISBT_PROJECT_VERSION="7"REDHAT_SUPPORT_PRODUCT="centos"REDHAT_SUPPORT_PRODUCT_VERSION="7"
lsb_release
$ lsb_release -rRelease: 7.2.1511
该命令默认没有被装置 须要自行装置
/etc/issue
hostnamectl
$ hostnamectl Static hostname: localhost.localdomain Icon name: computer-vm Chassis: vm Machine ID: 15ef07d6ca494a7f82fec477fa70b7e4 Boot ID: 1b607797966a487b8b72944f0ce619c2 Virtualization: vmware Operating System: CentOS Linux 7 (Core) CPE OS Name: cpe:/o:centos:centos:7 Kernel: Linux 3.10.0-327.el7.x86_64 Architecture: x86-64