|
From: | Pádraig Brady |
Subject: | Re: Feature request: df -b option for 512-byte blocks |
Date: | Tue, 10 Jan 2023 12:28:09 +0000 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Thunderbird/109.0 |
On 09/01/2023 22:04, Thomson Blakefield wrote:
Create new option 'df -b' like *BSD platforms, to explicitly use 512-byte blocks, overriding any BLOCKSIZE specification from the environment. BSD's options '-P' and '-b' are the same and use 512-byte blocks. However GNU 'df -P' uses 1024-byte block, which makes scripts not portable. I can use 'df -k' which is the same for both but results are inaccurate after conversion.
Given you can define a portable df-b function as follows, it's probably best not to add a -b option for this. df-b() { POSIXLY_CORRECT=1 df -P "$@"; } cheers, Pádraig
[Prev in Thread] | Current Thread | [Next in Thread] |