Linux Learning Note--DF/DU command (view disk Space command)

Source: Internet
Author: User
Tags disk usage

DF: English name disk free, check the use of the hard disk.
Du: English name disk usage, view the file size of the specified directory.

1. Command format

df[选项][文件]du[选项][文件]

2. DF Common Options

"df -a"    全部文件系统列表。"df -h"    人性化显示文件大小,如100K212G等。"df -k"    以k字节的形式表示文件的大小。(1k=1024Byte)"df -l"    只显示本地文件系统。"df -m"    以m字节的形式表示文件的大小。(1M=1024K)

3. Du common options

"du -a"    输出所有文件的磁盘用量,不仅仅是目录。"du -b"    以字节的形式表示文件的大小。"du -c"    显示总计信息。"du -h"    人性化显示文件大小,如100K212G等。"du -k"    以k字节的形式表示文件的大小。(1k=1024Byte)"du -m"    以m字节的形式表示文件的大小。(1M=1024K)"du -s"    仅显示总计,只列出最后加总的值。

4. Common examples:

1) 查看整个磁盘还剩多少空间。

2) 查看test目录的磁盘占用情况。

3) 查看test目录下的log.txt文件的磁盘占用情况。

4) 查看test目录以及子目录的磁盘占用情况。

5) 查看test目录下的文件和子目录的磁盘占用情况。

6) 查看test目录下的所有文件的磁盘占用情况。

Linux Learning Note--DF/DU command (view disk Space command)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.