I'm tired of using aliases or typing
-h. I want human readable output 24/7. Is there a way to enable it all the time for all commands that offer it?
From a search through the man pages, on a Linux system, I find that the command supporting a
--human-readable option are the following:
df dir du ls rsync vdir. This search is obviously limited to installed packages on this particular machine.
For each of them you can define an alias in
~/.bashrc if you use
bash as a login shell (or a function, if you prefer), like the following:
alias df='df --human-readable'
Ok, I read you would not use aliases, but once set in
.bashrc you can forget about them, so I cannot understand your request.
It does not seem that these applications support setting parameters through environment variables.
For GNU coreutils, including
du, you can set the
BLOCK_SIZE environment variable.
$ export BLOCK_SIZE=human-readable $ ls -l 4-megabyte-file -rw-r--r-- 1 mikel mikel 4.0M Dec 10 08:09 4-megabyte-file $ du 4-megabyte-file 4.0M 4-megabyte-file $ df . Filesystem Size Used Avail Use% Mounted on /dev/sdb1 110G 16G 89G 15% /