zoukankan      html  css  js  c++  java
  • Ubuntu下查看CPU、内存和硬盘详细信息的几个命令

    CPU:
    型号:grep "model name" /proc/cpuinfo |awk -F ':' '{print $NF}'
    数量:lscpu |grep "CPU socket" |awk '{print $NF}' 或 lscpu |grep "Socket" |awk '{print $NF}'
    每个CPU的核数:lscpu |grep "Core(s) per socket" |awk '{print $NF}'
    
    内存:
    卡槽数量:sudo dmidecode -t memory |grep "Number Of Devices" |awk '{print $NF}'或sudo dmidecode -t memory |grep "Associated Memory Slots" |awk '{print $NF}'
    内存数量:sudo dmidecode -t memory |grep -A16 "Memory Device$" |grep 'Size:.*MB' |wc -l
    内存型号:
    内存支持类型:sudo dmidecode -t memory |grep -A16 "Memory Device$" |grep "Type:"
    每个内存频率:sudo dmidecode -t memory |grep -A16 "Memory Device$" |grep "Speed:"
    每个内存大小:sudo dmidecode -t memory |grep -A16 "Memory Device$" |grep "Size:"
    释放缓冲区内存:echo 3 > /proc/sys/vm/drop_caches
    
    硬盘:
    硬盘数量、大小:sudo fdisk -l |grep "Disk /dev/sd"
    硬盘型号:sudo hdparm -i /dev/sda |grep "Model"
    
    遇到根目录占满的情况:
    查看磁盘文件系统与目录的占用情况:df -h
    查看最近30天内出现的占用大小超10000 blocks的文件:find / -xdev -type f -mtime -30 -size +10000
  • 相关阅读:
    不使用C++ 11的整数转字符串
    1090 危险品装箱(25 分)
    C++中vector,set,map自定义排序
    D
    7-2 幼儿园数学题(29 分)
    李白打酒
    C++ string和int相互转换
    1049 数列的片段和(20)(20 分)
    11. 盛最多水的容器
    7. 整数反转
  • 原文地址:https://www.cnblogs.com/shixiangwan/p/7066085.html
Copyright © 2011-2022 走看看