Helpful Information
 
 
Category: UNIX Help
list date with seconds from ls command

Hello friends,

When I use "ls -l" command, it only list date of file with hour and minutes. Is there option that I can see by seconds?

Thanks

ls -l --time-style=full-iso

Hi Strike, need little more help

it's not working!

tiger[netboss]/u01/app/netboss/sga/thresholding% ls -l --time-style=full-iso
ls: illegal option -- -
ls: illegal option -- e
ls: illegal option -- -
ls: illegal option -- y
ls: illegal option -- e
ls: illegal option -- =
ls: illegal option -- -
usage: ls -1RaAdCxmnlogrtucpFbqisfL [files]

I am using Solaris 8

Also I am using tcsh shell, if that's help you help me :)

- on some versions of unix you are not allowed to mix short and long parameters. not sure about solaris. and my "ls" has no long version for "-l".
- my "ls" also has this parameter: "--full-time", try this
- "man ls" and "ls --help" can also provide valuable help. only the ones on your system though... :rolleyes:

No, can't find it on Solaris 8 server. :(

It's such simple list and Unix is so inconsistant. Little disappointed.

Hmm, on the Solaris machine that I checked, it says that you use LC_TIME to affect the date output, but then it points to a nonexistant man page (environ(5)) for what to use ... maybe you have that man page.

OK, I will check it out. Thanks Strike!

So far I can get around using Perl:

perl -e 'foreach(@ARGV){$t =localtime ( ( ( stat ( $_ ) ) [9] ) ); printf("%-20s%s\n",$_,$t);}' *

pain, but works better with a simple alias :)










privacy (GDPR)