--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.
While you're there—or when you're in any folder (directory in Unix-speak)—you might want to know what's in it. To do that you use the ls (or list) command. Type ls and press the Return key, and you'll see the folders (and/or files) in the current directory.
The ls command is used to list files. "ls" on its own lists all files in the current directory except for hidden files.
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
The BSD (Mac OS X) version of ls
(installed as /usr/bin/ls
) does not support the --full-time
option.
The GNU version of ls
does support --full-time
. I have the GNU ls
installed in a different directory (/usr/gnu/bin/ls
).
ls
on your machine at all?/usr/bin
when you run scripts?If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With