lsblk: 列出所有块设备
[cathome@host ~]$lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
fd0 2:0 1 4K 0 disk
sda 8:0 0 100G 0 disk
├─sda1 8:1 0 500M 0 part /boot
├─sda2 8:2 0 49.5G 0 part
│ ├─centos-root 253:0 0 95.6G 0 lvm /
│ └─centos-swap 253:1 0 3.9G 0 lvm [SWAP]
└─sda3 8:3 0 50G 0 part
└─centos-root 253:0 0 95.6G 0 lvm /
sdb 8:16 0 100G 0 disk
└─appvg-lv_data 253:2 0 100G 0 lvm /data
sr0 11:0 1 1024M 0 rom
fdisk -l /dev/sda:查看sda这块硬盘的分区详细信息。此命令执行需要管理员权限
[root@host ~]# fdisk -l /dev/sda
Disk /dev/sda: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000a8b81
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 104857599 51915776 8e Linux LVM
/dev/sda3 104857600 209715199 52428800 8e Linux LVM
[root@host ~]#
du -sh /home: 查看文件大小
sha1sum config.conf 计算文件的sha1加密结果。用于检查文件是否被破坏
[root@host ~]# sha1sum anaconda-ks.cfg
afb4a3d49288cc5e5ba9e6ea41edea47f54e0fd6 anaconda-ks.cfg
free -h:查看内存使用情况
[root@host ~]# free -h
total used free shared buff/cache available
Mem: 62G 1.2G 59G 59M 1.9G 60G
Swap: 3.9G 0B 3.9G
cat /proc/partitions:查看硬盘分区
[root@host ~]# cat /proc/partitions
major minor #blocks name
2 0 4 fd0
8 0 104857600 sda
8 1 512000 sda1
8 2 51915776 sda2
8 3 52428800 sda3
8 16 104857600 sdb
11 0 1048575 sr0
253 0 100233216 dm-0
253 1 104853504 dm-1
253 2 4063232 dm-2