LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 02-05-2013, 05:37 PM   #1
petekat03
LQ Newbie
 
Registered: Dec 2010
Posts: 10

Rep: Reputation: 1
List long format mixed date formats


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
Attached Images
File Type: jpg list.jpg (14.0 KB, 11 views)
 
Old 02-05-2013, 06:05 PM   #2
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,234

Rep: Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545
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
 
Old 02-05-2013, 06:11 PM   #3
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
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.
 
1 members found this post helpful.
Old 02-05-2013, 06:52 PM   #4
petekat03
LQ Newbie
 
Registered: Dec 2010
Posts: 10

Original Poster
Rep: Reputation: 1
Thanks for the info
 
Old 02-05-2013, 06:56 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,666
Blog Entries: 54

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to change Thunderbird's date format in Date column LXer Syndicated Linux News 0 07-18-2012 03:11 AM
ls -l showing different date formats SmurfGGM Linux - Newbie 5 12-16-2008 05:26 PM
Regarding date Format ancys Programming 4 08-10-2006 06:35 AM
C++ list of mixed classes martinrp Programming 11 03-13-2006 01:00 PM
ELF format and other formats? Manish Programming 3 02-25-2002 09:17 PM


All times are GMT -5. The time now is 01:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration