ls --mtime ?
I thought this would have been asked here a dozen times, but no luck in a search, so I assume I'm just blind.
in ~.bashrc i have entered Code:
alias lsa='ls -Ahop --time-style +" %d.%b.%.%y %I:%M %p "' I've been up and down the ls man page and can't seem to find this option. How is it possible to dislay mtime rather than ctime? Another related question: can ls display directories first? Thanks for reading. |
if i am understand correctly then :
ls -ltu will work ... it will list in ascending order the most recent date and time modified down to the oldest date /time ... |
Hmmm....
this isn't really what I want. I want to be able to sort them alphabetically, yet display the modification time. Having them sort according to mtime will just slow me down. Thanks for your input. |
Not quite sure what the problem for you is,
but in the context of ls the ctime actually IS the last modification time. try adding --time=ctime to your ls statment. Cheers, Tink |
doh.....
I don't even want to admit this.......I was reading the time as a stupid american, day following month....I was wondering why most of the stuff in my home directory listed Jan04. /me hits himself Thanks for the help. |
No worries ... don't we ALL have blonde moments
once in a while? :) Cheers, Tink (temporary blonde) |
Found an answer to the second question:
alias lsal='ls -Ahop --time-style +" %d.%b.%y %I:%M %p " | grep /; ls -Ahop --time-style +" %d.%b.%y %I:%M %p " | grep -v /' It just does two lists, one for directories only, and one for everything excluding directories. |
Just out of curiosity:
Why that 'strange' format for the date & time? :) long-iso would be 'easier' to write, and would allow for sensible sorting if you needed to post- process the output... Cheers, Tink (with an aversion against American time format) :} |
Dunno...it doesn't seem strange to me. This is what the output looks like:
Code:
-rw------- 1 mik 35K 05.Jan.04 09:00 PM .xsession-errors |
Quote:
24 hour times for too long I guess... :) Code:
drwxr-xr-x 2 tink users 48 2003-09-03 20:29 zeosdbo is second nature ... Cheers, Tink |
Yes, sorting would be much easier that way. I haven't become accustomed to viewing 24-hour time though....I always have to subtract 12 from the latter numbers to figure out what time it is =o)
|
Looking at the WHOLE time, date & time,
it's also easier and more consistent... :) Cheers, Tink |
All times are GMT -5. The time now is 09:06 AM. |