# 显示磁盘分区的使用情况(第二个比较好用)
df -h
lsblk
# 查看硬盘挂载情况
fdisk -l
# 查看当前分区情况
df -l
# 显示指定目录或文件的磁盘适用情况,以人类可读的格式显示
du -h
# 显示目录中的文件和子目录的详细信息,包括文件大小和权限等
ls -l
# 一个可视化的磁盘使用情况分析工具,可以方便地查看磁盘占用情况,进行清理操作
ncdu
# 例:给未挂载的新硬盘"/dev/vdb:"添加新分区
fdisk /dev/vdb
# 查看所有命令介绍
m
{
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
g create a new empty GPT partition table
G create an IRIX (SGI) partition table
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk