ls

ls date format

ls date format

I like ls, but there are a few things that alway bothered me. The data format…. There is a small remedy. 🙂

ls -lah

-rwxrwxrwx 1 1004 1004  115K Nov 21  2008 999_2
-rwxrwxrwx 1 1004 1004  1.1M Apr 23  2010 9992_0
-rwxrwxrwx 1 1004 1004   55K Apr 23  2010 9992_1
-rwxrwxrwx 1 1004 1004  117K Apr 23  2010 9992_2
-rwxrwxrwx 1 1004 1004  1.1M Apr 23  2010 9993_0
-rwxrwxrwx 1 1004 1004   53K Apr 23  2010 9993_1
-rwxrwxrwx 1 1004 1004  109K Apr 23  2010 9993_2
-rwxrwxrwx 1 1004 1004  1.3M Apr 23  2010 9994_0
-rwxrwxrwx 1 1004 1004   53K Apr 23  2010 9994_1
-rwxrwxrwx 1 1004 1004  109K Apr 23  2010 9994_2
-rwxrwxrwx 1 1004 1004  904K Apr 23  2010 9995_0
-rwxrwxrwx 1 1004 1004   53K Apr 23  2010 9995_1
-rwxrwxrwx 1 1004 1004  110K Apr 23  2010 9995_2
-rwxrwxrwx 1 1004 1004  745K Apr 23  2010 9996_0
-rwxrwxrwx 1 1004 1004   50K Apr 23  2010 9996_1
-rwxrwxrwx 1 1004 1004  103K Apr 23  2010 9996_2
-rwxrwxrwx 1 1004 1004  1.1M Apr 23  2010 9997_0

ls -lah –time-style=long-iso

-rwxrwxrwx 1 1004 1004  115K 2008-11-21 19:34 999_2
-rwxrwxrwx 1 1004 1004  1.1M 2010-04-23 10:12 9992_0
-rwxrwxrwx 1 1004 1004   55K 2010-04-23 10:12 9992_1
-rwxrwxrwx 1 1004 1004  117K 2010-04-23 10:12 9992_2
-rwxrwxrwx 1 1004 1004  1.1M 2010-04-23 10:12 9993_0
-rwxrwxrwx 1 1004 1004   53K 2010-04-23 10:12 9993_1
-rwxrwxrwx 1 1004 1004  109K 2010-04-23 10:12 9993_2
-rwxrwxrwx 1 1004 1004  1.3M 2010-04-23 10:13 9994_0
-rwxrwxrwx 1 1004 1004   53K 2010-04-23 10:13 9994_1
-rwxrwxrwx 1 1004 1004  109K 2010-04-23 10:13 9994_2
-rwxrwxrwx 1 1004 1004  904K 2010-04-23 10:13 9995_0
-rwxrwxrwx 1 1004 1004   53K 2010-04-23 10:13 9995_1
-rwxrwxrwx 1 1004 1004  110K 2010-04-23 10:13 9995_2
-rwxrwxrwx 1 1004 1004  745K 2010-04-23 10:13 9996_0
-rwxrwxrwx 1 1004 1004   50K 2010-04-23 10:13 9996_1
-rwxrwxrwx 1 1004 1004  103K 2010-04-23 10:13 9996_2
-rwxrwxrwx 1 1004 1004  1.1M 2010-04-23 10:13 9997_0
%a     locale's abbreviated weekday name (e.g., Sun)
%A     locale's full weekday name (e.g., Sunday)
%b     locale's abbreviated month name (e.g., Jan)
%B     locale's full month name (e.g., January)
%c     locale's date and time (e.g., Thu Mar  3 23:05:25 2005)
%C     century; like %Y, except omit last two digits (e.g., 20)
%d     day of month (e.g., 01)
%F     full date; same as %Y-%m-%d
%H     hour (00..23)
%I     hour (01..12)
%m     month (01..12)
%M     minute (00..59)
%r     locale's 12-hour clock time (e.g., 11:11:04 PM)
%R     24-hour hour and minute; same as %H:%M
%s     seconds since 1970-01-01 00:00:00 UTC
%S     second (00..60)
%t     a tab
%T     time; same as %H:%M:%S
%x     locale's date representation (e.g., 12/31/99)
%X     locale's time representation (e.g., 23:13:48)
%y     last two digits of year (00..99)
%Y     year

ls -lah –time-style=+%F\ %H:%M

-rwxrwxrwx 1 1004 1004  115K 2008-11-21 19:34 999_2
-rwxrwxrwx 1 1004 1004  1.1M 2010-04-23 10:12 9992_0
-rwxrwxrwx 1 1004 1004   55K 2010-04-23 10:12 9992_1
-rwxrwxrwx 1 1004 1004  117K 2010-04-23 10:12 9992_2
-rwxrwxrwx 1 1004 1004  1.1M 2010-04-23 10:12 9993_0
-rwxrwxrwx 1 1004 1004   53K 2010-04-23 10:12 9993_1
-rwxrwxrwx 1 1004 1004  109K 2010-04-23 10:12 9993_2
-rwxrwxrwx 1 1004 1004  1.3M 2010-04-23 10:13 9994_0
-rwxrwxrwx 1 1004 1004   53K 2010-04-23 10:13 9994_1
-rwxrwxrwx 1 1004 1004  109K 2010-04-23 10:13 9994_2
-rwxrwxrwx 1 1004 1004  904K 2010-04-23 10:13 9995_0
-rwxrwxrwx 1 1004 1004   53K 2010-04-23 10:13 9995_1
-rwxrwxrwx 1 1004 1004  110K 2010-04-23 10:13 9995_2
-rwxrwxrwx 1 1004 1004  745K 2010-04-23 10:13 9996_0
-rwxrwxrwx 1 1004 1004   50K 2010-04-23 10:13 9996_1
-rwxrwxrwx 1 1004 1004  103K 2010-04-23 10:13 9996_2
-rwxrwxrwx 1 1004 1004  1.1M 2010-04-23 10:13 9997_0

2 thoughts on “ls date format”

  1. Oh my god, thank you very very much. That’s what I’ve been searching for but didn’t know that ls uses its own setting for the listed date format. Can this be changed that both the default system date and time format and the ls date time format are permanently (after reboot) set to long ISO format?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.