• Welcome to Computer Association of SIUE - Forums.
 

fixing output of 'ls'

Started by Jon, 2005-11-07T14:23:32-06:00 (Monday)

Previous topic - Next topic

Jon

I've been a bit annoyed with the output of 'ls' on my web hosting service.  For some reason, it seems that someone decided that ls should sort its output without case sensitivity rather than the old fashioned method (which I prefer) when the locale is set to "en-US" (i.e., it intermixes hidden files with non-hidden files, so I've got .ssh/ listed right before stuff/ and right after socketcode/).  Why would anyone want to do this?

If this behavior annoys you, too, be sure to set your locale to POSIX or to nothing.

export LANG=POSIX
or
export LANG=

While looking for this solution, I stumbled upon this page.  I'm not sure why, but this sure made me smile.
.........

William Grim

If you want to unset the value of an environment variable such as LANG, I would do
unset LANG
instead of just
export LANG=
because there may be some code that will go ahead and try to use the empty LANG string instead of ignoring the string and using a default value.  This may cause some programs to crash (none that I know).
William Grim
IT Associate, Morgan Stanley