Centos查看內存硬盤信息


1、 top命令

top命令經常用來監控linux的系統狀況,比如cpu、內存的使用,程序員基本都知道這個命令。
按 q 退出

這里寫圖片描述

2、free -m:看內存占用

這里寫圖片描述

主要看第一行Mem 總共 15710 M , 使用了 823 M , 剩余空閑 7895 M 。這個shared 223M 也不知道用在哪里。

3、 df -h :看硬盤占用率

這里寫圖片描述

 

4、 fdisk -l 

[root@LogServer ~]# fdisk -l

Disk /dev/sda: 146.7 GB, 146685296640 bytes
255 heads, 63 sectors/track, 17833 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b5c42

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64       17834   142734336   8e  Linux LVM

Disk /dev/mapper/VolGroup-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/VolGroup-lv_swap: 4160 MB, 4160749568 bytes
255 heads, 63 sectors/track, 505 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/VolGroup-lv_home: 88.3 GB, 88311070720 bytes
255 heads, 63 sectors/track, 10736 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

 

5、 lsblk 

[root@LogServer ~]# lsblk
NAME                        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                           8:0    1 136.6G  0 disk 
+¦sda1                        8:1    1   500M  0 part /boot
L¦sda2                        8:2    1 136.1G  0 part 
  +¦VolGroup-lv_root (dm-0) 253:0    0    50G  0 lvm  /
  +¦VolGroup-lv_swap (dm-1) 253:1    0   3.9G  0 lvm  [SWAP]
  L¦VolGroup-lv_home (dm-2) 253:2    0  82.3G  0 lvm  /home
sr0                          11:0    1  1024M  0 rom  

 

 

 

1,lsblk                                      查看分區和磁盤

2,df -h                                           查看空間使用情況

3,fdisk -l                                       分區工具查看分區信息

4,cfdisk /dev/sda                          查看分區

5,blkid                                          查看硬盤label(別名)

6,du
-sh ./*    統計當前目錄各文件夾大小
7,free -h    查看內存大小
8,cat /proc/cpuinfo| grep "cpu cores"| uniq   查看cpu核心

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM