Ubuntu Centos等linux系统怎样查看硬盘空间大小

2020年3月8日12:30:19系统教程评论185

Df命令是linux系统以磁盘分区为单位查看文件系统,可以加上参数查看磁盘剩余空间信息,命令格式:文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

df -hl文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

显示格式为:文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

文件系统 容量 已用 可用 已用% 挂载点文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

Filesystem Size Used Avail Use% Mounted on文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

/dev/hda2 45G 19G 24G 44% /文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

/dev/hda1 494M 19M 450M 4% /boot文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

/dev/hda6 4.9G 2.2G 2.5G 47% /home文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

/dev/hda5 9.7G 2.9G 6.4G 31% /opt文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

none 1009M 0 1009M 0% /dev/shm文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

/dev/hda3 9.7G 7.2G 2.1G 78% /usr/local文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

/dev/hdb2 75G 75G 0 100% /文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

/dev/hdb2 75G 75G 0 100% /文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

以上面的输出为例,表示的意思为:文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

HD硬盘接口的第二个硬盘(b),第二个分区(2),容量是75G,用了75G,可用是0,因此利用率是100%, 被挂载到根分区目录上(/)。文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

下面是相关命令的解释:文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

df -hl 查看磁盘剩余空间文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

df -h 查看每个根路径的分区大小文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

du -sh [目录名] 返回该目录的大小文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

du -sm [文件夹] 返回该文件夹总M数文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

更多功能可以输入一下命令查看:文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

df --help文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

du --help文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

查看硬盘的分区 #sudo fdisk -l文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

查看IDE硬盘信息 #sudo hdparm -i /dev/hda文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

查看STAT硬盘信息 #sudo hdparm -I /dev/sda 或 #sudo apt-get install blktool #sudo blktool /dev/sda id文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

查看硬盘剩余空间 #df -h #df -H文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

查看目录占用空间 #du -hs 目录名文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

优盘没法卸载 #sync fuser -km /media/usbdisk文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html

文章源自堕落的鱼-https://www.duoluodeyu.com/2605.html
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定