linux服务器中最重要的两个配置是CPU和内存。那么怎么开始查看CPU核数和内存,以及使用情况,是日常运维中使用最多的操作。

查看linux服务器cpu最简单的命令是 cat /proc/cpuinfo

查看linux服务器cpu最简单的命令是 lscpu

查看linux服务器内存

cat /proc/meminfo

查看linux服务器内存最简单的命令: free -h

lscpu信息
[root@tXX-XXX-app logs]# lscpu Architecture: x86_64 CPU op-mode(s): 32-bit,
64-bit Byte Order: Little Endian CPU(s): 4 On-line CPU(s) list: 0-3 Thread(s)
per core: 1 Core(s) per socket: 4 Socket(s): 1 NUMA node(s): 1 Vendor ID:
GenuineIntel CPU family: 6 Model: 85 Model name: Intel(R) Xeon(R) Platinum
8255C CPU @ 2.50GHz Stepping: 5 CPU MHz: 2494.140 BogoMIPS: 4988.28 Hypervisor
vendor: KVM Virtualization type: full L1d cache: 32K L1i cache: 32K L2 cache:
4096K L3 cache: 36608K NUMA node0 CPU(s): 0-3
可以看出操作系统的架构是x86 64位的操作系统。

CPU 操作模型支持32位 和 64位

byte Order 为 Little Endian

cpu核数为 4核

CPU主频为2.50GHZ

CPU缓存为4级缓存,分别为32k  32k  4096K  36608K

free -h 内存信息
[root@tXX-XXX-app logs]# free -h total used free shared buff/cache available
Mem: 15G 6.2G 266M 1.1M 8.7G 8.7G Swap: 0B 0B 0B
总内存 15G 已用 6.2G 可用8.7G

磁盘信息 du -h /home 查看home目录各文件夹占用磁盘空间大小。
[root@tXX-XX-app logs]# du -h /home 44M /home/docker/apps/eureka 8.0K
/home/docker/apps/nginx/conf.d/bak_20230227 16K /home/docker/apps/nginx/conf.d
8.0K /home/docker/apps/nginx/conf/bak_20230227 24K /home/docker/apps/nginx/conf
29M /home/docker/apps/nginx/www/ctg-member/ctg-member/assets 30M
/home/docker/apps/nginx/www/ctg-member/ctg-member 30M
/home/docker/apps/nginx/www/ctg-member 30M /home/docker/apps/nginx/www 12G
/home/docker/apps/nginx/logs 20K /home/docker/apps/nginx/cert 12G
/home/docker/apps/nginx 12G /home/docker/apps 16K /home/docker/script/apollo
36K /home/docker/script 12G /home/docker 392M /home/project/ctg-member-plat/jar
8.1M /home/project/ctg-member-plat/logs 16K
/home/project/ctg-member-plat/script/subscript 28K
/home/project/ctg-member-plat/script 400M /home/project/ctg-member-plat 52M
/home/project/sso/jar 56K /home/project/sso/logs 8.0K /home/project/sso/script
52M /home/project/sso 451M /home/project 12K
/home/redis/myredis/data/appendonlydir 16K /home/redis/myredis/data 24K
/home/redis/myredis 28K /home/redis 67M /home/tingyun 13G /home

技术
下载桌面版
GitHub
百度网盘(提取码:draw)
Gitee
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:[email protected]
QQ群:766591547
关注微信