Linux 服务器中的磁盘空间

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16054112/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 22:44:11  来源:igfitidea点击:

Disk Space in Linux Server

linux

提问by Mohammed Selman

How do we check the disk space left in a disk. Suppose if we have total disk space as below

我们如何检查磁盘中剩余的磁盘空间。假设我们的总磁盘空间如下

[root@abc ~]# fdisk -l|grep Disk

Disk /dev/sda: 250.0 GB, 250058268160 bytes

磁盘 /dev/sda:250.0 GB,250058268160 字节

How do we find how much is free in this 250GB disk.

我们如何找到这个 250GB 磁盘中有多少可用。

回答by Sandro Munda

You should use df -h

你应该使用 df -h

$ man df
df - report file system disk space usage

You can add the --totaloption to have the total. For example:

您可以添加--total选项以获得总数。例如:

$ df -h --total
...
...
total             135G   79G   51G  61% -

回答by Pradheep

use

df -h

df -h

more details are available at this link http://en.wikipedia.org/wiki/Df_%28Unix%29

更多详细信息请访问此链接http://en.wikipedia.org/wiki/Df_%28Unix%29

回答by Alex

You can use several commands

您可以使用多个命令

df -h

Link: more commands

链接:更多命令

回答by BKA

If you just wanna check, use "df"

如果您只想检查,请使用“df”

df -h lists all devices with human readable formats, but of course you can say 'df /dev/sda' to get the exact numbers.

df -h 列出了所有具有人类可读格式的设备,但当然你可以说 'df /dev/sda' 来获得确切的数字。

回答by MangeshBiradar

Use df -h.This command will display the file system disk space usage.

使用df -h。此命令将显示文件系统磁盘空间使用情况。

$ df -h

The above command will display the disk size details on terminal.

上面的命令将在终端上显示磁盘大小的详细信息。

For Ex:

例如:

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda
                       20G   14G  4.6G  76% /
/dev/sda1              99M   18M   77M  19% /boot

Here the Total disk size is 20G, Used is 14G and Free is 4.6G.

这里总磁盘大小为 20G,已使用为 14G 和Free is 4.6G.