Last active
July 1, 2024 11:14
-
-
Save nickbudi/11277384 to your computer and use it in GitHub Desktop.
Get Finder to sort like Windows Explorer a la terminal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Use list view in all Finder windows by default | |
| # Four-letter codes for the other view modes: `icnv`, `clmv`, `Flwv` | |
| defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv" | |
| # Set item arrangement to none (Windows style) | |
| defaults write com.apple.finder FXPreferredGroupBy -string "None" | |
| # Sort by kind in ascending order (Windows style) | |
| /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:ListViewSettings:columns:kind:ascending true" ~/Library/Preferences/com.apple.finder.plist | |
| /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:ExtendedListViewSettings:columns:4:ascending true" ~/Library/Preferences/com.apple.finder.plist | |
| # Sort Folders before files hack (Windows style) | |
| FILE=/System/Library/CoreServices/Finder.app/Contents/Resources/English.lproj/InfoPlist.strings | |
| # Backup InfoPlist.strings first if no backup exists | |
| [ -f $FILE.bak ] || sudo ditto $FILE $FILE.bak | |
| # Convert InfoPlist.strings to XML | |
| sudo plutil -convert xml1 $FILE | |
| # Add a space in front of 'Folder' string | |
| sudo sed -i '' 's/g\>Folder/g\> Folder/' $FILE > /dev/null | |
| # Convert InfoPlist.strings back to binary | |
| sudo plutil -convert binary1 $FILE | |
| # Remove all .DS_Store files to reset folder specific view options | |
| sudo find / -name ".DS_Store" -depth -exec rm -f {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

This performs the "space before folder" hack, does it? Handy!