[Techtalk] what the heck is it with locale and ls -l -- recap with correct outputs

Carla Schroder carla at bratgrrl.com
Thu Feb 23 18:09:53 UTC 2012


Heh, sorry for mail-bombing the list-- I keep getting mixed up and posting 
mistakes. So here is a recap for the benefit of anyone following alone, with 
correct outputs:

Two distros: Mint 12 and Fedora 16

Mint 12 has coreutils 8.5
Fedora 16 has coreutils 8.2

Both have the same locale: en_US.UTF-8

carla at mint ~ $ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

[carla at fedora ~]$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Both support a full range of locales, as confirmed with local -a, including 
en_US.UTF-8

There are no environmental variables or aliases that I can find that control 
date formatting for ls -l. Yet Fedora displays dates as LC_TIME="C":

[carla at fedora-verne etc]$ ls -l
drwxr-xr-x.  3 root root     4096 Nov  2 19:30 abrt
-rw-r--r--.  1 root root       46 Jan 11 11:29 adjtime
-rw-r--r--.  1 root root     1518 Aug 16  2011 aliases
-rw-r-----.  1 root smmsp   12288 Nov  2 19:30 aliases.db

While Mint displays correctly in long-iso:

carla at studio /etc $ ls -l
drwxr-xr-x  3 root  root      4096 2012-02-17 19:02 acpi
-rw-r--r--  1 root  root      2981 2011-10-12 08:08 adduser.conf
-rw-r--r--  1 root  root        10 2012-02-17 17:16 adjtime
drwxr-xr-x  2 root  root      4096 2011-10-12 08:11 akonadi

There are workarounds such as setting environmental variables or aliasing ls -
l.  These are simple to implement and they work.

The remaining puzzlement is why? What controls the defaults? I don't want to 
make this my life's work or drive my fellow Techtalkers crazy, but it would be 
nice to know. Someone somewheres suggested that it's a coreutils issue, that 
the default used to be TIME_STYLE=long-iso, and then with version 8.5 it 
changed to TIME_STYLE=locale. Which still doesn't explain Fedora.

best,
Carla

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Carla Schroder
ace Linux nerd
author of Linux Cookbook,
Linux Networking Cookbook,
Book of Audacity
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



More information about the Techtalk mailing list