Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.3: ls date format switched from previous releases' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.3: ls date format switched from previous releases
Authored by: cynikal on Jan 20, '04 11:25:03AM

perhaps you're unaware of this since you wrote your own script but.. ls has a built in sort-by-date flag.. i won't be a prick and say man ls though perhaps you should have :)

if you do -t it will sort with more recent dates at top, and oldest dates at the bottom..

there's even a way to reverse this sort, you guessed it, -r

oh and in case you want to sort by size, i didn't see a built in flag, but this works pretty well

ls -l|sort -n +4 (add -r to sort if you want reverse order and if you're interested only in files, pipe it into grep ^- before sort)

in any event, i agree with you that it's strange that apple would have done this weird modification of ls for no real reason.



[ Reply to This | # ]
10.3: ls date format switched from previous releases
Authored by: LC on Jan 20, '04 01:58:38PM
Don't forget sticky bit where the 1st char column is "t", fix your exp

[ Reply to This | # ]
10.3: ls date format switched from previous releases
Authored by: hopthrisC on Jan 20, '04 04:01:15PM
Wrong! The sticky flag is displayed as follows (see the man page):
                These next two apply only to the third character in the last
                group (other permissions).

                      T     The sticky bit is set (mode 1000), but not execute
                            or search permission.  (See chmod(1) or
                            sticky(8).)

                      t     The sticky bit is set (mode 1000), and is search-
                            able or executable.  (See chmod(1) or sticky(8).)


[ Reply to This | # ]
10.3: ls date format switched from previous releases
Authored by: LC on Jan 20, '04 04:17:07PM

Yeah right, it's at the right end, not the left (I forgot;) Larry.



[ Reply to This | # ]