Monday, April 7, 2008

OSX Finder: Sort Folder Before File

Most of switchers getting used with how windows and linux sorting folder and files. Under Windows Explorer or Gnome Nautilus or KDE Konqurer, folder have a priority and displayed first before files if your order by type (or kind under Mac OS X).

Mac OS X is more logic than other OS; under Finder, filetype .dmg (or any filetype starting before alphabet F) will display first before folder since folder filetype is folder (and starting with alphabet F). LOGIC, BUT MAKE ME SICK!!!


Here the trick to change this behavior under Finder.
  1. Open Terminal.
  2. Open InfoPlist.strings file using vi text editor as a root.
    sudo vi /System/Library/CoreServices/Finder.app/Contents/Resources/English.lproj/InfoPlist.strings

    (change English.lproj to your language)
  3. Find below line:
    /* General kind strings */
    "Folder" = "Folder";
  4. Do following change (by adding space before " Folder" word after equal sign).
    "Folder" = " Folder";
  5. Save the InfoPlist.strings file by press [esc], type wq (mean write and quit vi) then press [return]
  6. Close Terminal 
  7. Restart your Finder, right click on Finder icon while pressing the key[option] and select Relaunch your Finder.
  8. Open Finder and order by Kind. 
TARAAAA!!!.... COOOOLLL!!! HUH!!!


Update: Tested and no problem on Leopard and Snow Leopard.

p/s: If your InfoPlist.strings corrupted after you done the change and you don't copy it first, don't blame me. Blame your BRAIN!!!

39 comments:

Craig said...

Info.Plist.strings does not exist on Leopard. Any idea how to do this on leopard?

Fahmie said...

Craig,

Sorry, typo there. It's should be InfoPlist.strings file not Info.Plist.strings.I already made correction above.

Thanks for gave feedback :)

Anonymous said...

This is the worst English I've ever seen in my life.

Anonymous said...

Since this pops out in google...

PROPER INSTRUCTIONS:

1- open terminal
2- paste this into it:

sudo vi /System/Library/CoreServices/Finder.app/Contents/Resources/English.lproj/InfoPlist.strings

3- type in your password
4- type 'a' (this will allow you to edit the file)
5- edit so line 7 looks like this:
"Folder" = " Folder";
6- Press escape
7- type ':w' to write
8-type ':q' to quit

render7

andrewchoi said...

wow this was driving me nuts, thanks so much fahmie

Anonymous said...

A million thanks.

Anonymous said...

YOU ARE THE MAN!!

Anonymous said...

OSX is ueberlame.
Filedialog sort by size?
Working with multiple SMB shares on different IPs?
I could go on for hours: MAC is not an OS but a GUI for Photoshop and Blogging enthusiasts.

the thing i hate the most about it (besides Steve Jobs and any MACfag) is the fake-usability.
I run spaces...and can I pick a file from anywhere and just drag it on a skype chat window?
nooooooo, coz gayOS has no single trayicons for all tasks. Means: I need a mouse and keyboard just to dcc a file to the one in the chatwindow on anothert space. Windows and Linux/KDE can do that.
Seriously: 1 year of OSX and I vomit every day about its insufficiency.

Anonymous said...

Second that dude. All these self-proclaimed "Mac Experts" are no more than computer challenged wanna be's. These mac fanboys who can't even spell "ls" keep raving about how Mac's are so user friendly, when they've explored less than 1% of the functionality of a normal PC. Having a unix backend is fine and all, but I'll take Windows XP with cygwin any day (yup, MS really screwed itself with Vista. Hopefully Windows 7 will shut these Mac fanatics a bit)

Anonymous said...

Very nice find. Thank you for posting.
-m3rcy

Anonymous said...

great! any idea how to make this work in file open dialogs which only have "name" & "date modified" columns (ie no "Kind" to sort by)?

Anonymous said...

Yup, this doesn't seem to work in column view, because "arrange by" isn't active, in that case. Any ideas regarding this? Besides using icon view of course :)

Kris said...

I have Macbook Pro unibody with Leopard and I've done exactly as you said in your guide but it does not work. Finder still sorts the files and folders as before. Also the only way to use the "Sort by Kind" options is if the view is in symbol view. If I have listview the Sort options is graymarked.

Anonymous said...

10.5 does not give the option to sort by kind. 10.6 does.

Anonymous said...

10.5 does not give the option to sort by kind. 10.6 does.

Anonymous said...

10.5 does not give the option to sort by kind. 10.6 does.

Anonymous said...

Another annoying aspect of FINDER is that it doesn't display the full path in a location bar. Ummm... hello!!! I'd like to cut and paste that full path into a terminal window once in a while damnit. Just glad the mac I have at home was paid for by my employer. Without vmware installed, I'd be using a secondary computer. Another thing I could not stand was the default install was case insensitive (windows is too but you can fix that). Had to reinstall and choose journaled/case sensitive.

render7 thanks for the quick summarized version.

deverill said...

Just drag the file or folder to the terminal window, Anonymous, and it inserts the full path at the cursor position. No need to Edit/cut - edit/paste with the mouse, or worse yet, ctrl-C(opy) and ctrl-V(omit) to the term window.

I have found that a lot of things people complain about are just from trying to run a Mac like a Win-PC.

Matt Montag said...

This is a very good post. It should move to the first Google result for "finder group folders".

I have done a very similar trick in Windows XP. When using "Show in Groups" in Explorer, you have the same problem. Grouped by kind, but folders show up in the middle. Stupid. The solution is a registry edit to rename the "Folder" filetype to ">Folder" so that it is alphabetically first, exactly as this hack does for Mac OS X.

Thanks again.

SugarDaddy said...

Ah, that's a very clever way to do it. Nicely done. Unfortunately, it's still not quite satisfactory. You need to be in certain views to arrange by kind it seems. Additionally, if you arrange by kind, it doesn't automatically alphabetize the rest. It'd be nice to say "arrange by kind, name" to sort by type and then the name. Oh well, guess the only way to get a decent finder is to use an alternative.

Anonymous said...

Why don't you use just PathfFinder and drop the crap Apple Finder. Finder is very basic file manager. Apple even donn't allow 3rd party app developers to use their filesystem to store thumb and folder information. Therefore any 3rd party file manager won't remember per folder settings. And they say that Microsoft is rectrictive hahahaha. Hypocrites!

Sasa, Sanja i Oleg said...

Why don't you use just PathfFinder and drop the crap Apple Finder. Finder is very basic file manager. Apple even donn't allow 3rd party app developers to use their filesystem to store thumb and folder information. Therefore any 3rd party file manager won't remember per folder settings. And they say that Microsoft is restrictive hahahaha. Such a hypocrites!

Anonymous said...

Another flaw that newbies (like me) will miss:

You say "Save the InfoPlist.strings file by press [esc], type wq then press [return]"

It should say "Save the InfoPlist.strings file by press [esc], type :wq then press [return]" and maybe a comment of what :wq does, and what to expect on the screen.

Complain all you want, OS X is more stable than ANY version of Windows! From 3.0 thru Windows 7.

alexnhatle said...

awesome! Thanks a lot dude.

Now only Apple need to fix that Finder crash bug -10810

Xanderion said...

Hi. This was very useful, thank you!
Only... I am a newbie and just made my terminal crash in some way (I thought it worked exactly like cmd on Windows but it doesn't apparently).
New Terminal windows suggest that I write some "recover" command to restore files prior to modifying, but I don't know how to do: could you please walk me through it?
thank you soo much :)

Subtil et delicat said...

Thanks so much for that post. Lots of other posts just bother us saying "na na nah... osx should not look like windows"...

Yours just helps the user. Thanks a million!

Pat

mauro pinheiro said...

@Xanderion, you must have missed a tiny detail...have you put the ":" (without the quotes) before the commands?

My guess is that you have NOT typed the ":" (colon) before the commands. It is ":w", and ":q", not just "w" or "q".

The same way, when Terminal suggests you to recover the file, you should type ":recover" and not "recover". The colon is part of the command.

The original post assumes that you are familiar with terminal, so it doesn't explain it correctly. On the comments that followed the original post, @render7 shows exactly what you should write, but you may have missed this detail.

Read again the instructions as posted by @render7, follow the steps. Can't miss.

Anonymous said...

It worked! Thank you for the nifty solution :)

-Joseph

Alan Refaeli said...

Works great- if you are using a windows keyboard use the alt key and right click to relaunch instead of the options key.
Alan Refaeli

Bobby Norris said...

I love you. Not being able to sort folders before files has made my file management a nightmare working on sites over the years!!!

Well done.

Bobby Norris said...

Thanks heaps!

eth0 said...

what about MacOSX Lion ?

eth0 said...

What about MacOSX Lion ?

Fahmie Salleh said...

eth0,

My line so slow. May be next week I'm able to upgrade to lion. Anyway you can try and share the result. Just ensure make copy of InfoPlist.strings file. In case not working you can revert it back ;-)

Anonymous said...

has nayboy been able to do this on osx Lion? of so, please share how... !

Crates said...

Here's a link to an excellent post on how to do this on Mac OSX Lion 10.7.x in case anyone else was wondering.

http://nicnocquee.com/put-folders-on-top-when-sort-by-kind-in-mac-o

I tested it out, and the method described therein was successful.

أبو فيصل said...

I had found an indirect way to work around it with almost exact correct output, with files sorted alphabetically.

I used the Automator, check it:
http://www.quora.com/OS-X/How-can-I-make-folders-always-on-top-on-Mac-Finder-WITHOUT-arrange-by-kind/

if making folders on top is most important. you will need to label the files also, making sure that files label alphabetically comes after folders label.

I didn't do that because labeling every thing makes them looks ugly.

Anonymous said...

Want to know a very easy way? Just label your files and folders with colours! (Folders one colour and files another) Is a very manual way to do it but effective!

mahasiswa teladan said...

hi...Im student from Informatics engineering nice article,
thanks for sharing :)