LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   List long format mixed date formats (http://www.linuxquestions.org/questions/linux-general-1/list-long-format-mixed-date-formats-4175448760/)

petekat03 02-05-2013 05: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?

Thanks,

Pete

jlinkels 02-05-2013 06: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.

jlinkels

colucix 02-05-2013 06:11 PM

Quoted from info ls (formatting file timestamps section):
Code:

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
timestamps.

  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 06:52 PM

Thanks for the info

unSpawn 02-05-2013 06: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 02:51 AM.