I would like a method to capture the disk usage of a particular partition, by using the directory where the partition is mounted. The output should just be an integer with no padding or following symbols, as I'd like to save it in a variable.
df --output=pcent /mount/point, but need to trim the output as it has an unnecessary header, single space padding before the value, and a % symbol following the value like so:
In this case the output I would like would simply be
83. I'm not aware of any drawbacks to using the output of
df, but am happy to accept other methods that do not rely on it.