df Command
Purpose
Reports information about space on file systems. This document describes the AIX df command as well as the System V version of df.
Syntax
df [ [ -P ] | [ -I | -M | -i | -t | -v ] ] [ -k ] [ -m ] [ -g ] [ -s ] [FileSystem ... | File... ]
Description
The df command displays information about total space and available space on a file system. The FileSystem parameter specifies the name of the device on which the file system resides, the directory on which the file system is mounted, or the relative path name of a file system. The File parameter specifies a file or a directory that is not a mount point. If the File parameter is specified, the df command displays information for the file system on which the file or directory resides. If you do not specify the FileSystem or File parameter, the df command displays information for all currently mounted file systems. File system statistics are displayed in units of 512-byte blocks by default.
The df command gets file system space statistics from the statfs system call. However, specifying the -s flag gets the statistics from the virtual file system (VFS) specific file system helper. If you do not specify arguments with the -s flag and the helper fails to get the statistics, the statfs system call statistics are used. Under certain exceptional conditions, such as when a file system is being modified while the df command is running, the statistics displayed by the df command might not be accurate.
The df command does not fully support NFSv4 filesystems. Use the nfs4cl command to extract block and space information.
Flags
The values of the output parameters with the flags -m and -g would be rounded off to nearest second decimal digit. If all or any two of the -k, -m and -g flags are specified, the last one specified takes effect.
Exit Status
This command returns the following exit values:
0 | Successful completion. |
>0 | An error occurred. |
Examples
- To display information about all mounted file systems, enter:
df
If your system has the /, /usr, /site, and /usr/venus file systems mounted, the output from the df command resembles the following:
Filesystem 512-blocks Free %Used Iused %Iused Mounted on
/dev/hd0 19368 9976 48% 4714 5% /
/dev/hd1 24212 4808 80% 5031 19% /usr
/dev/hd2 9744 9352 4% 1900 4% /site
/dev/hd3 3868 3856 0% 986 0% /usr/venus - To display information about /test file system in 1024-byte blocks, enter:
df -k /test
Filesystem 1024 blocks Free %Used Iused %Iused Mounted on
This displays the file system statistics in 1024-byte disk blocks.
/dev/lv11 16384 15824 4% 18 1% /tmp/ravi1 - To display information about /test file system in MB blocks, enter:
df -m /test
Filesystem MB blocks Free %Used Iused %Iused Mounted on
This displays file system statistics in MB disk blocks rounded off to nearest 2nd decimal digit.
/dev/lv11 16.00 15.46 4% 18 1% /tmp/ravi1 - To display information about the /test file system in GB blocks, enter:
df -g /test
Filesystem GB blocks Free %Used Iused %Iused Mounted on
This displays file system statistics in GB disk blocks rounded off to nearest 2nd decimal digit.
/dev/lv11 0.02 0.02 0% 18 1% /tmp/ravi1 - To display available space on the file system in which your current directory resides, enter:
cd/
df .The output from this command resembles the following:
Device 512-blocks free %used iused %iused Mounted on
/dev/hd4 19368 9976 48% 4714 5% /
Files
/etc/filesystems | Lists the known file systems and defines their characteristics. |
/etc/vfs | Contains descriptions of virtual file system types. |
2 comments:
Please explain why free MB blocks are 15.46 vs total blocks 16.00 but % used is still showing 4%. Please also reply on (atiwari.sap@gmail.com)
df -m /testFilesystem MB blocks Free %Used Iused %Iused Mounted on/dev/lv11 16.00 15.46 4% 18 1% /tmp/ravi1
Please read the following in point 3.
This displays file system statistics in MB disk blocks rounded off to nearest 2nd decimal digit.
Post a Comment