df: Display Filesystem Disk Space Usage
The df command is used to display the disk space usage of mounted filesystems.
- Basic Usage:
$ df
-
Common Options:
-
-hor--human-readable: Display sizes in a human-readable format (K, M, G).
$ df -h-
-Tor--print-type: Display filesystem types.
$ df -T-
-aor--all: Display all filesystems, including pseudo, duplicate, inaccessible filesystems.
$ df -a-
-ior--inodes: Display inode information.
$ df -i -
du: Estimate File and Directory Space Usage
The du command estimates disk space usage of files and directories.
- Basic Usage:
$ du /path/to/directory
-
Common Options:
-
-hor--human-readable: Display sizes in a human-readable format (K, M, G).
$ du -h /path/to/directory -
-sor--summarize: Display only the total size of the specified directory.
$ du -s /path/to/directory
-
-aor--all: Display both directory and file information.
$ du -a /path/to/directory
-
-cor--total: Display the grand total.
$ du -c /path/to/directory
-
--max-depth=N: Display information up to a depth of N directories.
$ du --max-depth=1 /path/to/directory
Understanding the df and du commands is essential for monitoring disk space usage and managing file storage effectively.
Top comments (0)