NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: How to use the 'ls' -M flag?



On Fri, 26 May 2023, Michael Cheponis wrote:

I'm having no success trying to get ls to print file sizes, using the -M
flag.


The `thousands separator' char. is locale-specific. In the default C/POSIX
locale, it is "":

$ locale -c thousands_sep
LC_NUMERIC
$ LC_NUMERIC=C locale -c thousands_sep
thousands_sep=""
$ LC_NUMERIC=en_US.UTF-8 locale -k thousands_sep
thousands_sep=","
$ LC_NUMERIC=en_US.UTF-8 ls -lM /netbsd.GENERIC
-rwxr-xr-x  1 root  wheel  29,529,152 May 24 13:09 /netbsd.GENERIC
$

Set some locale in ~/.profile (or ~/.xinitrc, ~/.xsession, ...). Eg.:

export LANG=en_GB.UTF-8
export LC_CTYPE=$LANG
export LC_ALL=""

-RVP


Home | Main Index | Thread Index | Old Index