Finder Customization Management on macOS
Customize and manage Finder preferences across your MacFleet devices using command-line tools. This tutorial covers desktop display options, file visibility settings, interface customization, and enterprise-wide Finder configuration management.
Understanding macOS Finder Customization
Finder is the default file manager for macOS, and its behavior can be extensively customized using the defaults
command. Key areas of customization include:
- Desktop Display - Control what appears on desktop
- File Visibility - Show/hide files and extensions
- Interface Elements - Status bars, path displays, and warnings
- Sorting Behavior - How files and folders are organized
Desktop Display Management
Show Hard Disks on Desktop
#!/bin/bash
# Enable hard disk display on desktop
echo "đĨī¸ Enabling hard disk display on desktop..."
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true
killall Finder
if [ $? -eq 0 ]; then
echo "â
Hard disks will now appear on desktop"
else
echo "â Failed to update hard disk display setting"
exit 1
fi
Show External Hard Drives on Desktop
#!/bin/bash
# Enable external drive display on desktop
echo "đž Enabling external drive display on desktop..."
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
killall Finder
if [ $? -eq 0 ]; then
echo "â
External drives will now appear on desktop"
else
echo "â Failed to update external drive display setting"
exit 1
fi
Show Removable Media on Desktop
#!/bin/bash
# Enable removable media display on desktop
echo "đŋ Enabling removable media display on desktop..."
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
killall Finder
if [ $? -eq 0 ]; then
echo "â
Removable media (CDs, DVDs, iPods) will now appear on desktop"
else
echo "â Failed to update removable media display setting"
exit 1
fi
File Visibility Configuration
Show All Filename Extensions
#!/bin/bash
# Enable display of all file extensions
echo "đ Enabling display of all file extensions..."
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
killall Finder
if [ $? -eq 0 ]; then
echo "â
All file extensions will now be visible"
echo "âšī¸ Files like 'document.txt' and 'app.app' will show their extensions"
else
echo "â Failed to update file extension display setting"
exit 1
fi
Show Hidden Files
#!/bin/bash
# Enable display of hidden files
echo "đī¸ Enabling display of hidden files..."
defaults write com.apple.finder AppleShowAllFiles -bool true
killall Finder
if [ $? -eq 0 ]; then
echo "â
Hidden files will now be visible in Finder"
echo "â ī¸ Warning: Hidden files contain system data - modify with caution"
else
echo "â Failed to update hidden file display setting"
exit 1
fi
Interface Enhancement Settings
Enable Status Bar
#!/bin/bash
# Enable Finder status bar
echo "đ Enabling Finder status bar..."
defaults write com.apple.finder ShowStatusBar -bool true
killall Finder
if [ $? -eq 0 ]; then
echo "â
Status bar enabled - shows item count and available space"
else
echo "â Failed to enable status bar"
exit 1
fi
Show Full Path in Title Bar
#!/bin/bash
# Enable full path display in title bar
echo "đ¤ī¸ Enabling full path display in title bar..."
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
killall Finder
if [ $? -eq 0 ]; then
echo "â
Full file paths will now appear in Finder title bar"
else
echo "â Failed to enable path display in title bar"
exit 1
fi
Keep Folders on Top When Sorting
#!/bin/bash
# Enable folders-first sorting
echo "đ Enabling folders-first sorting..."
defaults write com.apple.finder _FXSortFoldersFirst -bool true
killall Finder
if [ $? -eq 0 ]; then
echo "â
Folders will now appear before files when sorting by name"
else
echo "â Failed to update folder sorting preference"
exit 1
fi
Security and Warning Settings
Enable Extension Change Warning
#!/bin/bash
# Enable warning before changing file extensions
echo "â ī¸ Enabling file extension change warning..."
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool true
killall Finder
if [ $? -eq 0 ]; then
echo "â
Warning dialog will appear before changing file extensions"
else
echo "â Failed to enable extension change warning"
exit 1
fi
Enable iCloud Drive Removal Warning
#!/bin/bash
# Enable warning before removing items from iCloud Drive
echo "âī¸ Enabling iCloud Drive removal warning..."
defaults write com.apple.finder FXEnableRemoveFromICloudDriveWarning -bool true
killall Finder
if [ $? -eq 0 ]; then
echo "â
Warning dialog will appear before removing items from iCloud Drive"
else
echo "â Failed to enable iCloud Drive removal warning"
exit 1
fi
Expand Information Window Panes
#!/bin/bash
# Configure information window panes to be expanded by default
echo "đ Configuring information window panes..."
defaults write com.apple.finder FXInfoPanesExpanded -dict \
General -bool true \
OpenWith -bool true \
Privileges -bool true
killall Finder
if [ $? -eq 0 ]; then
echo "â
General, Open With, and Privileges panes will be expanded by default"
else
echo "â Failed to configure information window panes"
exit 1
fi
Enterprise Finder Configuration Script
#!/bin/bash
# MacFleet Finder Customization Tool
# Standardize Finder preferences across fleet devices
# Configuration
LOG_FILE="/var/log/macfleet_finder.log"
BACKUP_DIR="/var/backups/macfleet/finder"
CONFIG_FILE="/etc/macfleet/finder_config.plist"
# Logging function
log_action() {
echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" | tee -a "$LOG_FILE"
}
# Create backup directory
setup_directories() {
if [[ ! -d "$BACKUP_DIR" ]]; then
mkdir -p "$BACKUP_DIR"
log_action "Created backup directory: $BACKUP_DIR"
fi
if [[ ! -d "$(dirname "$CONFIG_FILE")" ]]; then
mkdir -p "$(dirname "$CONFIG_FILE")"
log_action "Created configuration directory"
fi
}
# Backup current Finder preferences
backup_current_settings() {
local backup_file="$BACKUP_DIR/finder_backup_$(date +%Y%m%d_%H%M%S).plist"
echo "đĻ Creating backup of current Finder settings..."
# Export current Finder preferences
defaults export com.apple.finder "$backup_file" 2>/dev/null
if [ $? -eq 0 ]; then
echo "â
Backup created: $backup_file"
log_action "Backup created: $backup_file"
else
echo "â ī¸ Warning: Could not create backup"
log_action "Warning: Backup creation failed"
fi
}
# Apply enterprise Finder configuration
apply_finder_configuration() {
echo "đ§ Applying MacFleet Finder configuration..."
log_action "Starting Finder configuration deployment"
# Desktop display settings
echo "Configuring desktop display options..."
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
# File visibility settings
echo "Configuring file visibility options..."
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
defaults write com.apple.finder _FXSortFoldersFirst -bool true
# Interface enhancements
echo "Configuring interface elements..."
defaults write com.apple.finder ShowStatusBar -bool true
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
# Security warnings
echo "Configuring security warnings..."
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool true
defaults write com.apple.finder FXEnableRemoveFromICloudDriveWarning -bool true
# Information window configuration
echo "Configuring information window panes..."
defaults write com.apple.finder FXInfoPanesExpanded -dict \
General -bool true \
OpenWith -bool true \
Privileges -bool true
# Restart Finder to apply changes
echo "Restarting Finder to apply changes..."
killall Finder
if [ $? -eq 0 ]; then
echo "â
Finder configuration applied successfully"
log_action "Finder configuration deployment completed successfully"
else
echo "â Failed to restart Finder"
log_action "Error: Failed to restart Finder"
return 1
fi
}
# Verify configuration deployment
verify_configuration() {
echo "đ Verifying Finder configuration..."
local verification_passed=true
# Check desktop display settings
if [[ "$(defaults read com.apple.finder ShowHardDrivesOnDesktop 2>/dev/null)" == "1" ]]; then
echo "â
Hard drives on desktop: Enabled"
else
echo "â Hard drives on desktop: Failed"
verification_passed=false
fi
if [[ "$(defaults read com.apple.finder ShowExternalHardDrivesOnDesktop 2>/dev/null)" == "1" ]]; then
echo "â
External drives on desktop: Enabled"
else
echo "â External drives on desktop: Failed"
verification_passed=false
fi
# Check file visibility
if [[ "$(defaults read NSGlobalDomain AppleShowAllExtensions 2>/dev/null)" == "1" ]]; then
echo "â
Show all extensions: Enabled"
else
echo "â Show all extensions: Failed"
verification_passed=false
fi
# Check interface elements
if [[ "$(defaults read com.apple.finder ShowStatusBar 2>/dev/null)" == "1" ]]; then
echo "â
Status bar: Enabled"
else
echo "â Status bar: Failed"
verification_passed=false
fi
if $verification_passed; then
echo "â
All Finder configurations verified successfully"
log_action "Configuration verification passed"
return 0
else
echo "â Some configurations failed verification"
log_action "Configuration verification failed"
return 1
fi
}
# Generate configuration report
generate_report() {
local report_file="/tmp/finder_config_report_$(date +%Y%m%d_%H%M%S).txt"
{
echo "MacFleet Finder Configuration Report"
echo "Generated: $(date)"
echo "Hostname: $(hostname)"
echo "User: $(whoami)"
echo "======================================"
echo ""
echo "Desktop Display Settings:"
echo "Hard drives on desktop: $(defaults read com.apple.finder ShowHardDrivesOnDesktop 2>/dev/null || echo 'Not set')"
echo "External drives on desktop: $(defaults read com.apple.finder ShowExternalHardDrivesOnDesktop 2>/dev/null || echo 'Not set')"
echo "Removable media on desktop: $(defaults read com.apple.finder ShowRemovableMediaOnDesktop 2>/dev/null || echo 'Not set')"
echo ""
echo "File Visibility Settings:"
echo "Show all extensions: $(defaults read NSGlobalDomain AppleShowAllExtensions 2>/dev/null || echo 'Not set')"
echo "Show hidden files: $(defaults read com.apple.finder AppleShowAllFiles 2>/dev/null || echo 'Not set')"
echo "Folders first: $(defaults read com.apple.finder _FXSortFoldersFirst 2>/dev/null || echo 'Not set')"
echo ""
echo "Interface Settings:"
echo "Status bar: $(defaults read com.apple.finder ShowStatusBar 2>/dev/null || echo 'Not set')"
echo "Path in title: $(defaults read com.apple.finder _FXShowPosixPathInTitle 2>/dev/null || echo 'Not set')"
echo ""
echo "Security Settings:"
echo "Extension change warning: $(defaults read com.apple.finder FXEnableExtensionChangeWarning 2>/dev/null || echo 'Not set')"
echo "iCloud removal warning: $(defaults read com.apple.finder FXEnableRemoveFromICloudDriveWarning 2>/dev/null || echo 'Not set')"
} > "$report_file"
echo "đ Configuration report saved to: $report_file"
log_action "Configuration report generated: $report_file"
}
# Restore from backup
restore_from_backup() {
local backup_file="$1"
if [[ ! -f "$backup_file" ]]; then
echo "â Backup file not found: $backup_file"
return 1
fi
echo "đ Restoring Finder settings from backup..."
# Import backup
defaults import com.apple.finder "$backup_file"
if [ $? -eq 0 ]; then
echo "â
Settings restored from backup"
killall Finder
log_action "Settings restored from backup: $backup_file"
else
echo "â Failed to restore from backup"
log_action "Error: Failed to restore from backup: $backup_file"
return 1
fi
}
# Reset to defaults
reset_to_defaults() {
echo "đ Resetting Finder to default settings..."
# Remove custom settings
defaults delete com.apple.finder ShowHardDrivesOnDesktop 2>/dev/null
defaults delete com.apple.finder ShowExternalHardDrivesOnDesktop 2>/dev/null
defaults delete com.apple.finder ShowRemovableMediaOnDesktop 2>/dev/null
defaults delete NSGlobalDomain AppleShowAllExtensions 2>/dev/null
defaults delete com.apple.finder AppleShowAllFiles 2>/dev/null
defaults delete com.apple.finder ShowStatusBar 2>/dev/null
defaults delete com.apple.finder _FXShowPosixPathInTitle 2>/dev/null
defaults delete com.apple.finder _FXSortFoldersFirst 2>/dev/null
defaults delete com.apple.finder FXEnableExtensionChangeWarning 2>/dev/null
defaults delete com.apple.finder FXEnableRemoveFromICloudDriveWarning 2>/dev/null
defaults delete com.apple.finder FXInfoPanesExpanded 2>/dev/null
killall Finder
echo "â
Finder reset to default settings"
log_action "Finder reset to default settings"
}
# Main execution function
main() {
local action="${1:-deploy}"
log_action "=== MacFleet Finder Customization Started ==="
setup_directories
case "$action" in
"deploy")
backup_current_settings
apply_finder_configuration
verify_configuration
generate_report
;;
"verify")
verify_configuration
;;
"report")
generate_report
;;
"restore")
if [[ -n "$2" ]]; then
restore_from_backup "$2"
else
echo "â Please specify backup file path"
echo "Usage: $0 restore /path/to/backup.plist"
exit 1
fi
;;
"reset")
backup_current_settings
reset_to_defaults
;;
*)
echo "Usage: $0 [deploy|verify|report|restore|reset]"
echo ""
echo "Commands:"
echo " deploy - Apply MacFleet Finder configuration (default)"
echo " verify - Verify current configuration"
echo " report - Generate configuration report"
echo " restore - Restore from backup file"
echo " reset - Reset to default settings"
exit 1
;;
esac
log_action "=== MacFleet Finder Customization Completed ==="
}
# Execute main function
main "$@"
Configuration Reference
Setting | Command | Description |
---|---|---|
Hard drives on desktop | ShowHardDrivesOnDesktop | Display internal drives on desktop |
External drives on desktop | ShowExternalHardDrivesOnDesktop | Display external drives on desktop |
Removable media on desktop | ShowRemovableMediaOnDesktop | Display CDs, DVDs, iPods on desktop |
Show all extensions | AppleShowAllExtensions | Display file extensions for all files |
Show hidden files | AppleShowAllFiles | Display normally hidden system files |
Status bar | ShowStatusBar | Show item count and disk space |
Path in title | _FXShowPosixPathInTitle | Display full path in window title |
Folders first | _FXSortFoldersFirst | Sort folders before files |
Extension warning | FXEnableExtensionChangeWarning | Warn before changing extensions |
iCloud warning | FXEnableRemoveFromICloudDriveWarning | Warn before iCloud removal |
Quick Reference Commands
Enable All Desktop Items
# Show all desktop items
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
killall Finder
Enable Full Visibility
# Maximum file visibility
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
defaults write com.apple.finder AppleShowAllFiles -bool true
defaults write com.apple.finder ShowStatusBar -bool true
killall Finder
Enable All Security Warnings
# Enable all security warnings
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool true
defaults write com.apple.finder FXEnableRemoveFromICloudDriveWarning -bool true
killall Finder
Troubleshooting
Finder Not Restarting
# Force restart Finder
sudo pkill -f Finder
sleep 2
open /System/Library/CoreServices/Finder.app
Settings Not Applying
# Clear Finder cache and restart
sudo rm -rf ~/Library/Caches/com.apple.finder
killall Finder
Verify Settings Applied
# Check specific setting
defaults read com.apple.finder ShowStatusBar
# List all Finder settings
defaults read com.apple.finder
Security Considerations
- Hidden files contain system data - modify with caution
- File extensions help identify file types - consider security implications
- Desktop items may clutter interface in shared environments
- Test changes on individual devices before fleet deployment
- Create backups before applying configuration changes
Important Notes
- Changes require Finder restart to take effect
- Some settings apply system-wide (NSGlobalDomain)
- User-specific settings don't affect other accounts
- Administrative privileges may be required for system-wide deployment
- Backup current settings before making changes for easy restoration