CPU和内存查询

CPU和内存查询

   张吉吉     2019年9月29日 00:48     1475    

linux:

查看内存数量:dmidecode |grep -P -A5 "Memory\s+Device" |grep Size | grep -v Range

查看内存支持最大容量:dmidecode |grep -P 'Maximum\s+Capacity'

查看内存使用情况:free

查看现有内存的大小

grep MemTotal /proc/meminfo

查看交换分区的大小

grep SwapTotal /proc/meminfo

查看共享内存数量的命令

df -h /dev/shm

查看磁盘空间大小

df -h /tmp

查询内存脚本

------------------------------------------------------

rm tmp.txt

top -f tmp.txt

user=`cat tmp.txt |grep "avg"|awk '{print $3}'`

sys=`cat tmp.txt |grep "avg"|awk '{print $5}'`

idle=`cat tmp.txt |grep "avg"|awk '{print $6}'`

mem=`cat tmp.txt |grep "mory"|awk '{print $2}'`

fre=`cat tmp.txt |grep "mory"|awk '{print $8}'`

echo "user:$user sys:$sys idle:$idle mem:$mem free:$fre `date`">>result

more result

------------------------------------------------------

 

ps -e -o "pcpu,pid,vsz,args"|sort -rn |more 按照内存占用从大到小排列

查看操作系统位数:

-----------------------------------------------------------

在solaris上面:如何查看系统内核是32位的还是64位的?

isainfo -b isainfo -v

在hpux上面:#/bin/getconf KERNEL_BITS

在aix上面:bootinfo -y

aix上是否开启aio:

lsdev -Cc aio

-------------------------------------------------------------

查看suse的内存使用情况,使用free -k命令查出来的结果准确。

-------------------------------------------------------------

查看cpu

查看cpu数量:cat /proc/cpuinfo | grep processor | wc -l

---------------------------------------------

在aix和hp上面:

lsdev -C | grep Process | wc -l

lscfg |grep proc lsattr -El proc0

lscfg |grep mem lsattr -El mem0

-------------------------------------------

unix:

machinfo 查询系统相关信息

---------------------


文章评论

0

其他文章