[Linux Command] df displays the disk space usage

Source: Internet
Author: User

Displays disk space usage.

Df [options] [filesystem-list]

The utility df (disk free) reports the total space and free space of each mounted device.

Reasons for inconsistent usage of disk space displayed by df and du and troubleshooting

Linux Command cd

Cat for Linux commands

Linux Command alias/unalias

Linux Command Parsing: su root and su-root

Interactive input of Linux commands read

When df is called without any parameters, the user obtains free space for each mounted device on the local system. filesystem is an optional list of one or more path names. The path name is used to specify the file system that will cover its space usage. this parameter is used on Mac OS X and some Linux systems. you can use the device path name or the path name of the mounted directory to specify the mounted file system. the option that starts with two connection characters (--) is only used in Linux. unless otherwise specified, the single-character option that starts with a connection character (-) can be used for OS X and Linux. -- all-
A file system with a report block size of 0, for example,/dev/proc. generally, df will not report these file systems. -- block-size = sz-B szsz is used to specify the Unit for reporting (the block size is 1 kb by default ). -g
(Gigabyte) displays the block size in GB (for OS X only ). -- si-H displays the block size in KB, MB (MB), and GB (GB. used to calculate the power of 1024. -- human-readable-h displays the block size in KB (kilobytes), MB (megabytes), and GB (gigabytes. used to calculate the power of 1024. -- inodes-I
Reports the number of used and unused index nodes, instead of the block size.-k (kilobyte) displays the block size in KB. -- local-l
Displays the local file system. -m (megabyte) reports the size in MB (only for OS X )........ note that in Mac OS X, the df utility supports BLOCKSIZE environment variables, ignoring blocks smaller than 512 bytes or larger than 1 GB. in Mac OS x, the number of inode (-I option) used and not used is meaningless in the HFS + file system. on these file systems, as long as the file system firm has free space, you can create new files. in the following example, df displays information about all mounted file systems on the local system:

Www.bkjia.com @ linux :~ $ Df
Filesystem 1K-blocks Used Available Use % Mounted on
/Dev/sda6 284234328 21624120 248148820 9%/
None 4 0 4 0%/sys/fs/cgroup
Udev 1944100 4 1944096 1%/dev
Tmpfs 390968 1184 389784 1%/run
None 5120 0 5120 0%/run/lock
None 1954836 22956 1931880 2%/run/shm
None 102400 52 102348 1%/run/user
Www.bkjia.com @ linux :~ $

The following example uses the-l and-h options to call df to generate a list of readable local file systems, in MB and GB.

Www.bkjia.com @ linux :~ $ Df-lh
Filesystem Size Used Avail Use % Mounted on
// Dev/sda6 272G 21G 237G 9%/
None 4.0 K 0 4.0 K 0%/sys/fs/cgroup
Udev 1.9G 4.0 K 1.9G 1%/dev
Tmpfs 382 M 1.2 M 381 M 1%/run
None 5.0 M 0 5.0 M 0%/run/lock
None 1.9G 23 M 1.9G 2%/run/shm
None 100 M 52 K 100 M 1%/run/user
Www.bkjia.com @ linux :~ $

The following example shows the/partition information, in MB:

Www.bkjia.com @ linux :~ $ Df-BM/
Filesystem 1M-blocks Used Available Use % Mounted on
/Dev/sda6 277573 M 21118 M 242333 M 9%/
Gopain @ gopain :~ $

Displays information about the NFS file system:

Www.bkjia.com @ linux :~ $ Df-ht nfs
Df: no file systems processed
Www.bkjia.com @ linux :~ $

Because my disk does not have this file system .......

This article permanently updates the link address:

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.