Skip to content

Instantly share code, notes, and snippets.

@nickbudi
Last active July 1, 2024 11:14
Show Gist options
  • Select an option

  • Save nickbudi/11277384 to your computer and use it in GitHub Desktop.

Select an option

Save nickbudi/11277384 to your computer and use it in GitHub Desktop.

Revisions

  1. nickbudi revised this gist Aug 28, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    Get Finder.app to sort folders first like Windows Explorer a la terminal.
    Get Finder to sort folders first like Windows Explorer a la terminal.

    **Note**: This hack is no longer needed in High Sierra. Just run `defaults write com.apple.finder _FXSortFoldersFirst -bool true`

  2. nickbudi revised this gist Aug 28, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    Get Finder.app to sort like Windows Explorer a la terminal.
    Get Finder.app to sort folders first like Windows Explorer a la terminal.

    A snippet from my Ansible OS X workstation playbook (repo soon). Tested in OS X 10.9.2 Mavericks
    **Note**: This hack is no longer needed in High Sierra. Just run `defaults write com.apple.finder _FXSortFoldersFirst -bool true`

    ## Results
    ![Results](http://i.imgur.com/pOsGlM8.png)
  3. nickbudi revised this gist Oct 24, 2014. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion osx-finder.sh
    Original file line number Diff line number Diff line change
    @@ -25,5 +25,6 @@ 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 {} \;

    # Restart Finder
    # Restart cfprefsd and Finder
    killAll cfprefsd
    killAll Finder
  4. nickbudi revised this gist Jul 8, 2014. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion osx-finder.sh
    Original file line number Diff line number Diff line change
    @@ -6,8 +6,10 @@ defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
    defaults write com.apple.finder FXPreferredGroupBy -string "None"

    # Sort list view 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:sortColumn kind" ~/Library/Preferences/com.apple.finder.plist
    /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:ExtendedListViewSettings:columns:4:ascending true" ~/Library/Preferences/com.apple.finder.plist
    /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:ListViewSettings:sortColumn kind" ~/Library/Preferences/com.apple.finder.plist
    /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:ListViewSettings:columns:kind: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
  5. nickbudi revised this gist Apr 27, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    Get Finder.app to sort like Windows Explorer a la terminal, because ![Automate all the things!](http://i.imgur.com/J6VigHK.jpg)
    Get Finder.app to sort like Windows Explorer a la terminal.

    A snippet from my Ansible OS X workstation playbook (repo soon). Tested in OS X 10.9.2 Mavericks

  6. nickbudi revised this gist Apr 26, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -5,5 +5,5 @@ A snippet from my Ansible OS X workstation playbook (repo soon). Tested in OS X
    ## Results
    ![Results](http://i.imgur.com/pOsGlM8.png)
    Two things to note:
    + Unfortunately files are sorted by kind first then alphabetically. Double check the location of bootstrap.sh in the screenshot for example. This is as close as I could get it to Windows Explorer for now.
    + Unfortunately files are sorted by kind first then alphabetically. Check the location of bootstrap.sh in the screenshot for example. This is as close as I could get it to Windows Explorer for now.
    + I've left folder dropdowns. I think I like folder dropdowns for moving files between subfolders with ease, we'll see.
  7. nickbudi revised this gist Apr 26, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@ Get Finder.app to sort like Windows Explorer a la terminal, because ![Automate a
    A snippet from my Ansible OS X workstation playbook (repo soon). Tested in OS X 10.9.2 Mavericks

    ## Results
    ![Results](http://i.imgur.com/CiFXwB5.png)
    ![Results](http://i.imgur.com/pOsGlM8.png)
    Two things to note:
    + Unfortunately files are sorted by kind first then alphabetically. Double check the location of bootstrap.sh in the screenshot for example. This is as close as I could get it to Windows Explorer for now.
    + I've left folder dropdowns. I think I like folder dropdowns for moving files between subfolders with ease, we'll see.
  8. nickbudi revised this gist Apr 25, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion osx-finder.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    # Use list view in all Finder windows by default
    # Four-letter codes for the other view modes: `icnv`, `clmv`, `Flwv`
    # Four-letter codes for the other view modes: 'icnv', 'clmv', 'Flwv'
    defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"

    # Set item arrangement to none (enables folder dropdowns, 'Name' if you want to remove them)
  9. nickbudi revised this gist Apr 25, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -5,5 +5,5 @@ A snippet from my Ansible OS X workstation playbook (repo soon). Tested in OS X
    ## Results
    ![Results](http://i.imgur.com/CiFXwB5.png)
    Two things to note:
    + Unfortunately files are sorted by kind first then alphabetically. Double check the location of bootstrap.sh in the screenshot as an example. This is as close as I could get it to Windows Explorer for now.
    + Unfortunately files are sorted by kind first then alphabetically. Double check the location of bootstrap.sh in the screenshot for example. This is as close as I could get it to Windows Explorer for now.
    + I've left folder dropdowns. I think I like folder dropdowns for moving files between subfolders with ease, we'll see.
  10. nickbudi revised this gist Apr 25, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -5,5 +5,5 @@ A snippet from my Ansible OS X workstation playbook (repo soon). Tested in OS X
    ## Results
    ![Results](http://i.imgur.com/CiFXwB5.png)
    Two things to note:
    + I've left folder dropdowns. I think I like folder dropdowns for moving files between subfolders, we'll see.
    + Unfortunately files are sorted by kind first then alphabetically. Double check the location of bootstrap.sh in the screenshot as an example. This is as close as I could get it to Windows Explorer for now.
    + Unfortunately files are sorted by kind first then alphabetically. Double check the location of bootstrap.sh in the screenshot as an example. This is as close as I could get it to Windows Explorer for now.
    + I've left folder dropdowns. I think I like folder dropdowns for moving files between subfolders with ease, we'll see.
  11. nickbudi revised this gist Apr 25, 2014. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -4,4 +4,6 @@ A snippet from my Ansible OS X workstation playbook (repo soon). Tested in OS X

    ## Results
    ![Results](http://i.imgur.com/CiFXwB5.png)
    Note: I've left folder dropdowns. I think I like them for moving files between subfolders, we'll see.
    Two things to note:
    + I've left folder dropdowns. I think I like folder dropdowns for moving files between subfolders, we'll see.
    + Unfortunately files are sorted by kind first then alphabetically. Double check the location of bootstrap.sh in the screenshot as an example. This is as close as I could get it to Windows Explorer for now.
  12. nickbudi revised this gist Apr 25, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion osx-finder.sh
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    # Four-letter codes for the other view modes: `icnv`, `clmv`, `Flwv`
    defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"

    # Set item arrangement to none (enables folder dropdown, 'Name' if you want to remove them)
    # Set item arrangement to none (enables folder dropdowns, 'Name' if you want to remove them)
    defaults write com.apple.finder FXPreferredGroupBy -string "None"

    # Sort list view by kind in ascending order (Windows style)
  13. nickbudi revised this gist Apr 25, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions osx-finder.sh
    Original file line number Diff line number Diff line change
    @@ -22,4 +22,6 @@ 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 {} \;

    # Restart Finder
    killAll Finder
  14. nickbudi revised this gist Apr 25, 2014. 2 changed files with 3 additions and 2 deletions.
    3 changes: 2 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -3,4 +3,5 @@ Get Finder.app to sort like Windows Explorer a la terminal, because ![Automate a
    A snippet from my Ansible OS X workstation playbook (repo soon). Tested in OS X 10.9.2 Mavericks

    ## Results
    ![Results](http://i.imgur.com/CiFXwB5.png)
    ![Results](http://i.imgur.com/CiFXwB5.png)
    Note: I've left folder dropdowns. I think I like them for moving files between subfolders, we'll see.
    2 changes: 1 addition & 1 deletion osx-finder.sh
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    # Four-letter codes for the other view modes: `icnv`, `clmv`, `Flwv`
    defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"

    # Set item arrangement to none (enables folder dropdown)
    # Set item arrangement to none (enables folder dropdown, 'Name' if you want to remove them)
    defaults write com.apple.finder FXPreferredGroupBy -string "None"

    # Sort list view by kind in ascending order (Windows style)
  15. nickbudi revised this gist Apr 25, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion osx-finder.sh
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    # 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)
    # Set item arrangement to none (enables folder dropdown)
    defaults write com.apple.finder FXPreferredGroupBy -string "None"

    # Sort list view by kind in ascending order (Windows style)
  16. nickbudi revised this gist Apr 25, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions osx-finder.sh
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ 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)
    # Sort list view 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

    @@ -20,6 +20,6 @@ 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 settings
    # Remove all .DS_Store files to reset folder specific view options
    sudo find / -name ".DS_Store" -depth -exec rm -f {} \;
    killAll Finder
  17. nickbudi revised this gist Apr 25, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion osx-finder.sh
    Original file line number Diff line number Diff line change
    @@ -20,6 +20,6 @@ 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
    # Remove all .DS_Store files to reset folder specific view settings
    sudo find / -name ".DS_Store" -depth -exec rm -f {} \;
    killAll Finder
  18. nickbudi revised this gist Apr 25, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    Get Finder.app to sort like Windows Explorer a la terminal, because ![Automate all the things!](http://i.imgur.com/J6VigHK.jpg)

    Snippet from my Ansible OS X workstation playbook (repo soon). Tested in OS X 10.9.2 Mavericks
    A snippet from my Ansible OS X workstation playbook (repo soon). Tested in OS X 10.9.2 Mavericks

    ## Results
    ![Results](http://i.imgur.com/CiFXwB5.png)
  19. nickbudi revised this gist Apr 25, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    Get Finder.app to sort like Windows Explorer a la terminal, because automating everything totally isn't overkill right? ;)
    Get Finder.app to sort like Windows Explorer a la terminal, because ![Automate all the things!](http://i.imgur.com/J6VigHK.jpg)

    Tested in OS X 10.9.2 Mavericks
    Snippet from my Ansible OS X workstation playbook (repo soon). Tested in OS X 10.9.2 Mavericks

    ## Results
    ![Results](http://i.imgur.com/CiFXwB5.png)
  20. nickbudi revised this gist Apr 25, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,6 @@
    Get Finder.app to sort like Windows Explorer a la terminal, because automating everything totally isn't overkill right? ;)

    Tested in OS X 10.9.2 Mavericks

    ## Results
    ![Results](http://i.imgur.com/CiFXwB5.png)
  21. nickbudi revised this gist Apr 25, 2014. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion osx-finder.sh
    Original file line number Diff line number Diff line change
    @@ -21,4 +21,5 @@ sudo sed -i '' 's/g\>Folder/g\> Folder/' $FILE > /dev/null
    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 {} \;
    sudo find / -name ".DS_Store" -depth -exec rm -f {} \;
    killAll Finder
  22. nickbudi revised this gist Apr 25, 2014. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1 +1,4 @@
    ![results](http://i.imgur.com/Kt3sGom.png)
    Get Finder.app to sort like Windows Explorer a la terminal, because automating everything totally isn't overkill right? ;)

    ## Results
    ![Results](http://i.imgur.com/CiFXwB5.png)
  23. nickbudi revised this gist Apr 25, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    ![results](http://i.imgur.com/Kt3sGom.png)
  24. nickbudi revised this gist Apr 25, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion osx-finder.sh
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ 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, ascending (Windows style)
    # 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

  25. nickbudi created this gist Apr 25, 2014.
    24 changes: 24 additions & 0 deletions osx-finder.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    # 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, ascending (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 {} \;