How is the overall disk usage calculated in the 'df -h --total' output?

The overall disk usage in the df -h --total output is calculated by summing up the total size, used space, and available space across all mounted file systems. Here's how it works:

  1. Total Size: This is the sum of the sizes of all mounted file systems.
  2. Used Space: This is the total amount of disk space that is currently being used across all mounted file systems.
  3. Available Space: This indicates how much disk space is still free and can be used.

The percentage of disk usage is calculated using the formula:

Used Percentage = (Used Space / Total Size) * 100

The -h option makes the output human-readable, displaying sizes in KB, MB, or GB. The --total option adds a final line that summarizes the total usage across all file systems.

0 Comments

no data
Be the first to share your comment!