15

In older versions of Ubuntu, like 9.10, ls(1) produced ISO 8601 format by default, in the way

ls -l --time-style=long-iso

does it. With 12.04, we're back at the older Unix style. Thus replacing the year by minutes and seconds for recent dates.

How can I - in the least intrusive manner change this back to long-iso? Is there maybe some general configuration option?

13

I know this question is quite old (more than 1 year old), but for posterity, let me share the tip as originally described in this blog post (not mine). In summary, this one line does everything you want:

export TIME_STYLE=long-iso

stick that line into /etc/profile, or a file in /etc/profile.d/, or even in ~/.bashrc, and you're good to go.

13

I was convinced that ls took its default arguments from the environment variable LS_OPTIONS, but its man page makes no mention of this.

My solution would be to set an alias to ls in ~/.bash_aliases or ~/.bashrc:

alias ls='ls --time-style=long-iso'

Which instantly makes it work for the common ll alias as well.

  • 1
    +1, but isn't there a better, that is, more principled - Ubuntu style for this? U often puts another layer of config on top of it. – false Mar 17 '13 at 0:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.