The “df” command in Linux and Unix is used to display the amount of disk space used and available on the file system. The command can be used with various options to display the information in different formats. Some examples of how to use the “df” command are:
- To display information about all file systems in a human-readable format:
df -h
- To display information about a specific file system, for example the file system mounted at “/”:
df /
- To show inode information about file system
df -i
- To show information about all mounted filesystems of a specific type, for example ext4:
df -T ext4
- To show the total amount of disk space used by a directory and its subdirectories:
du -sh /path/to/directory
- To show the amount of disk space used by a specific file or directory:
du -sh /path/to/file or directory
It is important to note that the du command is used to show the disk usage of files and directories, while df command is used to show the disk usage of file systems.