Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

command in Linux

$ ls -lt --time-style=full-iso

output

...
-rw-r--r--  1 mduda mduda   1855 2009-08-26 13:07:55.000000000 +0200 screen-configurations.xml
drwxr-xr-x  2 mduda mduda   4096 2009-08-26 13:07:22.000000000 +0200 Documents
drwxr-xr-x  2 mduda mduda   4096 2009-08-26 13:07:22.000000000 +0200 Music
drwxr-xr-x  2 mduda mduda   4096 2009-08-26 13:07:22.000000000 +0200 Pictures
share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

This comes close:

stat -l -t "%F %T %z" *

but without the sort, columns don't line up and the nanoseconds aren't included. Plus the syntax for file selection is different and other options for ls aren't available or are different.

This one might be closer:

find . -maxdepth 1 -printf "%M %n %-6u %-6g %6s %TY-%Tm-%Td %TT %TZ %f\n"|sort -k 9

In Mac OSX, gfind is needed (brew install gfind) (and note that the granularity will only be in whole seconds):

gfind . -maxdepth 1 -printf "%M %n %-6u %-6g %6s %TY-%Tm-%Td %TT %TZ %f\n"|sort -k 9

share|improve this answer
    
Close enough. thanks! –  Mad_Dud Aug 30 '09 at 20:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.