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


Click here to return to the 'Finder sorting different to shell sorting' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Finder sorting different to shell sorting
Authored by: haighy on Jun 25, '03 03:31:21PM

Incidentally, does it drive anyone else to despair that the Finder doesn't sort files like the shell? In the Finder, files are sorted 0,1,2,3,4,5,6,7,8,9,10,11 etc, whereas in any shell I've ever used they're sorted 0,1,10,100,11,12,13,14 and so on. I work with a lot of graphics where order is crucial, and a little bit of consistency would be helpful...anyone have any ideas? Perhaps this is slated to be a preference in Panther?



[ Reply to This | # ]
Finder sorting different to shell sorting
Authored by: osxpounder on Jun 25, '03 04:14:52PM

I wouldn't say I despair over it, but I am occasionally tripped up by the difference between the Finder sort order and the shell's--I like the Finder better, since it's designed to sort the way humans would, but I can see why shells and other, less sophisticated computer interfaces sort differently. I think if I had the option to make Finder consistent with the shell's method of sorting, I wouldn't use it often, but when I did, I'd want that to be a per-folder setting... so that I wouldn't upset other folders if I just happened to want *this* folder to sort differently.

---
--
osxpounder



[ Reply to This | # ]
Finder sorting different to shell sorting
Authored by: GEllenburg on Jun 25, '03 06:52:54PM

Try this:

ls -lv

Or:

ls -v

I just touched 40 sequential files in my /tmp folder and with the -v switch, they were all sorted numerically rather than by strings.

---
He who does not challenge one's elected decisions today, may find himself challenged by them tomorrow.

[ Reply to This | # ]

Finder sorting different to shell sorting
Authored by: thaigan on Jun 25, '03 07:37:18PM

'ls -v' and 'ls -lv' don't seem to work for me at all; any ideas why?

However, this works for me:
ls | sort -n



[ Reply to This | # ]
Finder sorting different to shell sorting
Authored by: thaigan on Jun 25, '03 07:40:15PM

In fact, this is from the manpage for ls:
-v Force unedited printing of non-graphic characters; this is the default when output is not to a terminal.



[ Reply to This | # ]
Finder sorting different to shell sorting - solved, sorta
Authored by: haighy on Jun 26, '03 04:05:05AM

Thanks for the helpful suggestions...however there still exists a problem in that when recursively processing files using perl and File::Find, they're returned in the default shell order. So if I rename a file in the Finder to insert it in between two existing files, such as calling a file 011 to put it between 01 and 02, they'll be sorted correctly when the perl script runs but not when viewing them in the Finder. If you get me. Anyway, I found that if I named it 01a it'll be sorted identically in both situations. So I've ceased despairing :o)



[ Reply to This | # ]