-   Linux - General (
-   -   List long format mixed date formats (

petekat03 02-05-2013 04:37 PM

List long format mixed date formats
1 Attachment(s)
Hi all,

Something I've noticed for years is that when you list a directory in the long format, I get some files showing time instead of year in the same column.

Why does it vary between year and time?



jlinkels 02-05-2013 05:05 PM

When a file is less than a year old only the date and time is displayed because that is unambiguous. Long standing Unix tradition.


colucix 02-05-2013 05:11 PM

Quoted from info ls (formatting file timestamps section):

By default, file timestamps are listed in abbreviated form.  Most
locales use a timestamp like `2002-03-30 23:45'.  However, the default
POSIX locale uses a date like `Mar 30  2002' for non-recent timestamps,
and a date-without-year and time like `Mar 30 23:45' for recent

  A timestamp is considered to be "recent" if it is less than six
months old, and is not dated in the future.  If a timestamp dated today
is not listed in recent form, the timestamp is in the future, which
means you probably have clock skew problems which may break programs
like `make' that rely on file timestamps.

petekat03 02-05-2013 05:52 PM

Thanks for the info

unSpawn 02-05-2013 05:56 PM

One of the few traditions I could do without so my 'ls' alias has the "--full-time --time-style=long-iso" switches.

All times are GMT -5. The time now is 11:34 PM.