• 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核心
  • 相关阅读:
    去哪儿网门票数据爬虫更新
    每周进度总结12
    每日进度总结20
    每日进度总结19
    每日进度总结18
    每日进度总结17
    每日进度总结16
    每日进度总结15
    每日进度总结14
    每周进度总结11
  • 原文地址:https://www.cnblogs.com/xiaomai-rhce/p/10141794.html
Copyright © 2020-2023  润新知