--full-time is a handy little option for ls but it doesn't work when used in a batch file.
ls -al --full-time when used at the command prompt yields a an expanded date and time:
2012-01-16 18:56:00.000000000
used in a bash script I got this:
ls: illegal option -- - usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]
is there any way around this.
for native ls
command, option -T
seems to be the alternative of --full-time
, and it expands to seconds, example as below:
>$ ls -lT
-rw-r--r-- 1 raison staff 197 Feb 14 09:12:56 2013 1.c
-rw-r--r-- 1 raison staff 1174 Mar 8 09:34:49 2013 1.s
-rw-r--r-- 1 raison staff 993 Feb 5 14:44:09 2013 1.x86.s