What about:
df --total
Hint: first look at the man df
page: man df
. Itβs hard for me these days to find aspects for the program that have not been implemented by some good flag. Linux people just seem to know what programmers want / need.
Or if you want everything in all:
df --total | tail -n 1
And if you want to specify it in a special block format (for example, TB
), you can set the -B
flag:
df --total -BT | tail -n 1
And in case you are only interested in the overall size (for example, you want to use the result in another bash
program):
df --total -BT | tail -n 1 | sed -E 's/total *([^ ]*).*/\1/'
source share