How to use the Linux df command

Source: Internet
Author: User
Tags memory usage readable disk usage

The Linux df command is used to display the disk usage statistics of the file system on Linux.

Syntax

Df [option]... [FILE]...

  • FILE-a, -- all contains all file systems with 0 Blocks
  • FILE -- block-size = {SIZE} use Blocks of {SIZE} size
  • FILE-h, -- human-readable uses a human-readable format (the preset value does not include this option ...)
  • FILE-H, -- si is like-h, but 1000 is used instead of 1024
  • FILE-I, -- inodes: list inode information, not list used blocks
  • FILE-k, -- kilobytes is like -- block-size = 1024
  • FILE-l, -- local restrict the structure of the listed files
  • FILE-m, -- megabytes is like -- block-size = 1048576
  • FILE -- no-sync: Do not sync before obtaining information (default value)
  • FILE-P, -- portability uses POSIX output format
  • FILE-sync before obtaining information
  • FILE-t, -- type = TYPE restrict listing types of file systems
  • FILE-T, -- print-type display format of the file system
  • FILE-x, -- exclude-type = TYPE restrict listing file systems from displaying TYPE
  • FILE-v (ignore)
  • FILE -- help shows this helper and leaves
  • FILE -- version outputs version information and leaves

Instance

Displays the disk usage statistics of the file system:

# Df

Filesystem 1K-blocks Used Available Use % Mounted on

/Dev/sda6 29640780 4320704 23814388 16%/

Udev 1536756 4 1536752 1%/dev

Tmpfs 617620 888 616732 1%/run

None 5120 0 5120 0%/run/lock

None 1544044 156 1543888 1%/run/shm

The first column specifies the name of the file system, the second column specifies a specific file system 1 K-Block 1 K is 1024 bytes of total memory. Memory Usage specified by and available columns.

Use the column to specify the percentage of memory used, and the last column is "installed on" The Mount point of the specified file system.

Df can also display the file system information used by the disk:

# Df test

Filesystem 1K-blocks Used Available Use % Mounted on

/Dev/sda6 29640780 4320600 23814492 16%/

The output of the-I option df command shows inode information rather than block usage.

Df-I

Filesystem Inodes IUsed IFree IUse % Mounted on

/Dev/sda6 1884160 261964 1622196 14%/

Udev 212748 560 212188 1%/dev

Tmpfs 216392 477 215915 1%/run

None 216392 3 216389 1%/run/lock

None 216392 8 216384 1%/run/shm

Show all information:

# Df -- total

Filesystem 1K-blocks Used Available Use % Mounted on

/Dev/sda6 29640780 4320720 23814372 16%/

Udev 1536756 4 1536752 1%/dev

Tmpfs 617620 892 616728 1%/run

None 5120 0 5120 0%/run/lock

None 1544044 156 1543888 1%/run/shm

Total 33344320 4321772 27516860 14%

We can see that the end of the output contains an additional row, showing each of the total columns.

-H option, which can generate the output of the readable format df command:

# Df-h

Filesystem Size Used Avail Use % Mounted on

/Dev/sda6 29g 4.2G 23G 16%/

Udev 1.5G 4.0 K 1.5G 1%/dev

Tmpfs 604 M 892 K 603 M 1%/run

None 5.0 M 0 5.0 M 0%/run/lock

None 1.5G 156 K 1.5G 1%/run/shm

We can see that the output displays numbers in the form of 'G' (GB), "M" (MB), and "K" (kilobytes ).

This makes the output easy to read and understand, so that the display is readable. Note that the name of the second column also changes to make the display readable "size ".

Related Article

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.