macos-terminal.md (21766B)
1 --- 2 title: "macOS Terminal Tweaks" 3 description: "Hidden macOS terminal/defaults tweaks and productivity commands for the CLI." 4 category: linux-it 5 tags: [macos, terminal, productivity] 6 tools: [defaults, zsh] 7 difficulty: beginner 8 updated: "2026-08-09" 9 source: "vault:macOS/macOS Terminal Tweaks Cheat Sheet.md" 10 --- 11 12 # macOS Terminal Tweaks 13 14 > **How `defaults` works —** `defaults write <domain> <key> <type> <value>` writes a preference. `defaults delete <domain> <key>` removes it (restoring the macOS default). Most changes need the affected app restarted — commands below include `killall` where needed. `killall SystemUIServer` restarts the menu bar; `killall Dock` restarts the Dock. 15 16 ## Table of Contents 17 18 Dock · Finder · Desktop · Screenshots · Animations & UI Speed · Mission Control & Spaces · Keyboard · Trackpad & Mouse · Safari · Mail · TextEdit · Calendar · Spotlight · Power & Sleep (pmset) · Network · Security & Privacy · Activity Monitor · Time Machine · Launchpad · Hot Corners Reference · Miscellaneous System 19 20 --- 21 22 ## Dock 23 24 ### Autohide Behaviour 25 ```bash 26 # Delay before Dock appears on hover (0 = instant) 27 defaults write com.apple.dock autohide-delay -float 0; killall Dock 28 29 # Animation speed (0 = instant, 1 = default) 30 defaults write com.apple.dock autohide-time-modifier -float 0.2; killall Dock 31 32 # Enable autohide 33 defaults write com.apple.dock autohide -bool true; killall Dock 34 35 # Reset both to macOS defaults 36 defaults delete com.apple.dock autohide-delay 37 defaults delete com.apple.dock autohide-time-modifier 38 killall Dock 39 ``` 40 41 ### Appearance & Size 42 ```bash 43 # Dock icon size (pixels, default 48) 44 defaults write com.apple.dock tilesize -int 48; killall Dock 45 46 # Enable magnification 47 defaults write com.apple.dock magnification -bool true; killall Dock 48 49 # Magnification size (pixels) 50 defaults write com.apple.dock largesize -int 72; killall Dock 51 52 # Dock position: bottom | left | right 53 defaults write com.apple.dock orientation -string "bottom"; killall Dock 54 55 # Minimise window effect: genie | scale | suck 56 defaults write com.apple.dock mineffect -string "scale"; killall Dock 57 58 # Dim hidden app icons 59 defaults write com.apple.dock showhidden -bool true; killall Dock 60 61 # Show indicator dots for open apps 62 defaults write com.apple.dock show-process-indicators -bool true; killall Dock 63 64 # Show recent apps section 65 defaults write com.apple.dock show-recents -bool false; killall Dock 66 ``` 67 68 ### Behaviour 69 ```bash 70 # Only show apps that are open (no pinned apps) 71 defaults write com.apple.dock static-only -bool true; killall Dock 72 73 # Single app mode (hides all other apps when switching) 74 defaults write com.apple.dock single-app -bool true; killall Dock 75 76 # Scroll up on Dock icon to show Exposé for that app 77 defaults write com.apple.dock scroll-to-open -bool true; killall Dock 78 79 # Enable spring-loading for all Dock items 80 defaults write com.apple.dock enable-spring-load-actions-on-all-items -bool true; killall Dock 81 82 # Disable launch animation bounce 83 defaults write com.apple.dock launchanim -bool false; killall Dock 84 85 # Add a blank spacer tile to the Dock 86 defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'; killall Dock 87 ``` 88 89 ### Launchpad / Springboard Animation Speeds 90 ```bash 91 defaults write com.apple.dock springboard-show-duration -float 0.1; killall Dock 92 defaults write com.apple.dock springboard-hide-duration -float 0.1; killall Dock 93 defaults write com.apple.dock springboard-page-duration -float 0.15; killall Dock 94 ``` 95 96 --- 97 98 ## Finder 99 100 ### Show / Hide 101 ```bash 102 # Show hidden files (dotfiles) 103 defaults write com.apple.finder AppleShowAllFiles -bool true; killall Finder 104 105 # Show all filename extensions 106 defaults write NSGlobalDomain AppleShowAllExtensions -bool true; killall Finder 107 108 # Show path bar at the bottom 109 defaults write com.apple.finder ShowPathbar -bool true; killall Finder 110 111 # Show status bar at the bottom 112 defaults write com.apple.finder ShowStatusBar -bool true; killall Finder 113 114 # Show full POSIX path in title bar 115 defaults write com.apple.finder _FXShowPosixPathInTitle -bool true; killall Finder 116 117 # Allow quitting Finder via Cmd+Q 118 defaults write com.apple.finder QuitMenuItem -bool true; killall Finder 119 120 # Keep folders on top when sorting by name 121 defaults write com.apple.finder _FXSortFoldersFirst -bool true; killall Finder 122 123 # Keep folders on top on the Desktop too 124 defaults write com.apple.finder _FXSortFoldersFirstOnDesktop -bool true; killall Finder 125 ``` 126 127 ### Default View 128 ```bash 129 # Set default view style: 130 # Nlsv = List | icnv = Icon | clmv = Column | Flwv = Gallery 131 defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"; killall Finder 132 ``` 133 134 ### Warnings & Behaviour 135 ```bash 136 # Disable extension change warning 137 defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false; killall Finder 138 139 # Disable Trash empty warning 140 defaults write com.apple.finder WarnOnEmptyTrash -bool false; killall Finder 141 142 # Auto-remove items from Trash after 30 days 143 defaults write com.apple.finder FXRemoveOldTrashItems -bool true; killall Finder 144 145 # Disable iCloud as default save location 146 defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false 147 148 # Expand save panel by default 149 defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true 150 defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true 151 152 # Expand print panel by default 153 defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true 154 defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true 155 ``` 156 157 ### Search Scope 158 ```bash 159 # Search current folder by default (SCcf = current folder | SCev = entire volume) 160 defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"; killall Finder 161 ``` 162 163 ### Animations 164 ```bash 165 # Disable all Finder animations 166 defaults write com.apple.finder DisableAllAnimations -bool true; killall Finder 167 ``` 168 169 --- 170 171 ## Desktop 172 173 ```bash 174 # Hide all desktop icons (useful for presentations / clean screenshots) 175 defaults write com.apple.finder CreateDesktop -bool false; killall Finder 176 177 # Show hard drives on Desktop 178 defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true; killall Finder 179 180 # Show external hard drives on Desktop 181 defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true; killall Finder 182 183 # Show mounted network servers on Desktop 184 defaults write com.apple.finder ShowMountedServersOnDesktop -bool true; killall Finder 185 186 # Show removable media (USB, SD) on Desktop 187 defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true; killall Finder 188 ``` 189 190 --- 191 192 ## Screenshots 193 194 ```bash 195 # Change save location (change path as needed) 196 defaults write com.apple.screencapture location ~/Desktop 197 198 # Change file format: png | jpg | heic | gif | pdf | tiff 199 defaults write com.apple.screencapture type -string "png" 200 201 # Disable shadow / drop shadow around window screenshots 202 defaults write com.apple.screencapture disable-shadow -bool true 203 204 # Disable floating thumbnail (the preview in corner after screenshot) 205 defaults write com.apple.screencapture show-thumbnail -bool false 206 207 # Don't include date in screenshot filename 208 defaults write com.apple.screencapture include-date -bool false 209 210 # Apply changes (no restart needed after this) 211 killall SystemUIServer 212 ``` 213 214 --- 215 216 ## Animations & UI Speed 217 218 > **Tip —** Run all blocks below for a completely snappy UI experience. 219 220 ### System-Wide (NSGlobalDomain) 221 ```bash 222 # Disable window open/close animations 223 defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false 224 225 # Disable scroll animations 226 defaults write NSGlobalDomain NSScrollAnimationEnabled -bool false 227 228 # Speed up window resize time (default 0.2, lower = faster) 229 defaults write NSGlobalDomain NSWindowResizeTime -float 0.001 230 231 # Disable rubber-band / elastic scrolling 232 defaults write NSGlobalDomain NSScrollViewRubberbanding -bool false 233 234 # Speed up Quick Look panel animation 235 defaults write NSGlobalDomain QLPanelAnimationDuration -float 0 236 237 # Speed up toolbar full screen animation 238 defaults write NSGlobalDomain NSToolbarFullScreenAnimationDuration -float 0 239 240 # Speed up column browser animation 241 defaults write NSGlobalDomain NSBrowserColumnAnimationSpeedMultiplier -float 0.001 242 243 # Disable version browser animation 244 defaults write NSGlobalDomain NSDocumentRevisionsWindowTransformAnimation -bool false 245 ``` 246 247 ### Dock 248 ```bash 249 defaults write com.apple.dock expose-animation-duration -float 0.1; killall Dock 250 defaults write com.apple.dock launchanim -bool false; killall Dock 251 ``` 252 253 ### Finder 254 ```bash 255 defaults write com.apple.finder DisableAllAnimations -bool true; killall Finder 256 ``` 257 258 ### Mail 259 ```bash 260 defaults write com.apple.mail DisableReplyAnimations -bool true 261 defaults write com.apple.mail DisableSendAnimations -bool true 262 ``` 263 264 --- 265 266 ## Mission Control & Spaces 267 268 ```bash 269 # Speed up Mission Control animation 270 defaults write com.apple.dock expose-animation-duration -float 0.1; killall Dock 271 272 # Don't automatically rearrange Spaces based on use 273 defaults write com.apple.dock mru-spaces -bool false; killall Dock 274 275 # Group windows by application in Mission Control 276 defaults write com.apple.dock expose-group-apps -bool true; killall Dock 277 278 # Displays have separate Spaces 279 defaults write com.apple.spaces spans-displays -bool false; killall Dock 280 281 # Switch to a Space with an open window when switching apps 282 defaults write NSGlobalDomain AppleSpacesSwitchOnActivate -bool true 283 ``` 284 285 --- 286 287 ## Keyboard 288 289 ```bash 290 # Enable key repeat (disable accent popup on hold) 291 defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false 292 293 # Key repeat rate (lower = faster, minimum ~1) 294 defaults write NSGlobalDomain KeyRepeat -int 2 295 296 # Delay before key repeat starts (lower = faster, minimum ~10) 297 defaults write NSGlobalDomain InitialKeyRepeat -int 15 298 299 # Enable full keyboard navigation (Tab between all controls) 300 defaults write NSGlobalDomain AppleKeyboardUIMode -int 3 301 302 # Disable smart quotes (useful for coding) 303 defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false 304 305 # Disable smart dashes 306 defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false 307 308 # Disable autocorrect 309 defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false 310 311 # Disable auto-capitalisation 312 defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false 313 314 # Disable double-space period shortcut 315 defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false 316 ``` 317 318 --- 319 320 ## Trackpad & Mouse 321 322 ### Trackpad 323 ```bash 324 # Enable tap to click 325 defaults write com.apple.AppleMultitouchTrackpad Clicking -bool true 326 defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true 327 defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1 328 329 # Enable three-finger drag 330 defaults write com.apple.AppleMultitouchTrackpad TrackpadThreeFingerDrag -bool true 331 defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadThreeFingerDrag -bool true 332 333 # Disable natural scrolling 334 defaults write NSGlobalDomain com.apple.swipe-navigate-with-scrolls -bool false 335 336 # Enable swipe-to-navigate in browsers 337 defaults write NSGlobalDomain AppleEnableSwipeNavigateWithScrolls -bool true 338 ``` 339 340 ### Mouse 341 ```bash 342 # Disable mouse acceleration (linear movement) 343 defaults write .GlobalPreferences com.apple.mouse.linear -bool true 344 345 # Set mouse tracking speed (0.0–3.0) 346 defaults write NSGlobalDomain com.apple.mouse.scaling -float 2.5 347 348 # Set scroll speed 349 defaults write NSGlobalDomain com.apple.scrollwheel.scaling -float 0.6875 350 ``` 351 352 --- 353 354 ## Safari 355 356 ```bash 357 # Show full URL in address bar (not just domain) 358 defaults write com.apple.Safari ShowFullURLInSmartSearchField -bool true 359 360 # Disable search suggestions 361 defaults write com.apple.Safari SuppressSearchSuggestions -bool true 362 defaults write com.apple.Safari UniversalSearchEnabled -bool false 363 364 # Enable Develop menu 365 defaults write com.apple.Safari IncludeDevelopMenu -bool true 366 defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true 367 368 # Enable debug menu 369 defaults write com.apple.Safari IncludeInternalDebugMenu -bool true 370 371 # Disable auto-opening of downloaded "safe" files 372 defaults write com.apple.Safari AutoOpenSafeDownloads -bool false 373 374 # Set history limit in days (default 31) 375 defaults write com.apple.Safari WebKitHistoryAgeInDaysLimit -int 365 376 377 # Disable thumbnail cache for History and Top Sites 378 defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2 379 ``` 380 381 --- 382 383 ## Mail 384 385 ```bash 386 # Disable send animation 387 defaults write com.apple.mail DisableSendAnimations -bool true 388 389 # Disable reply animation 390 defaults write com.apple.mail DisableReplyAnimations -bool true 391 392 # Copy email addresses as 'Name <email>' not just 'email' 393 defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool true 394 395 # Disable inline attachments (show as icons) 396 defaults write com.apple.mail DisableInlineAttachmentViewing -bool true 397 398 # Disable spell checking 399 defaults write com.apple.mail SpellCheckingBehavior -string "NoSpellCheckingEnabled" 400 ``` 401 402 --- 403 404 ## TextEdit 405 406 ```bash 407 # Use plain text mode by default 408 defaults write com.apple.TextEdit RichText -int 0 409 410 # Set encoding to UTF-8 411 defaults write com.apple.TextEdit PlainTextEncoding -int 4 412 defaults write com.apple.TextEdit PlainTextEncodingForWrite -int 4 413 414 # Disable smart quotes in TextEdit 415 defaults write com.apple.TextEdit SmartQuotes -bool false 416 ``` 417 418 --- 419 420 ## Calendar 421 422 ```bash 423 # Show week numbers 424 defaults write com.apple.iCal "Show Week Numbers" -bool true 425 426 # Set first day of week: 0=Sunday, 1=Monday, 2=Tuesday... 427 defaults write com.apple.iCal "first day of week" -int 1 428 429 # Show 24-hour clock 430 defaults write com.apple.iCal "number of hours displayed" -int 14 431 ``` 432 433 --- 434 435 ## Spotlight 436 437 ```bash 438 # Disable Spotlight indexing for a volume 439 sudo mdutil -i off / 440 441 # Enable Spotlight indexing for a volume 442 sudo mdutil -i on / 443 444 # Rebuild Spotlight index for a volume 445 sudo mdutil -E / 446 447 # Disable Spotlight indexing for ALL volumes 448 sudo mdutil -a -i off 449 ``` 450 451 --- 452 453 ## Power & Sleep (pmset) 454 455 > **Warning —** These require `sudo`. 456 457 ```bash 458 # Show current power settings 459 pmset -g 460 461 # Set display sleep time in minutes (0 = never) 462 sudo pmset -a displaysleep 10 463 464 # Set system sleep time in minutes (0 = never) 465 sudo pmset -a sleep 30 466 467 # Disable Power Nap (background activity while sleeping) 468 sudo pmset -a powernap 0 469 470 # Enable Wake on Network Access 471 sudo pmset -a womp 1 472 473 # Set standby delay in seconds (default 10800 = 3 hours) 474 sudo pmset -a standbydelay 86400 475 476 # Disable TCP keep-alive during sleep (saves battery) 477 sudo pmset -a tcpkeepalive 0 478 479 # Hibernate mode: 480 # 0 = sleep only (RAM powered, fast wake) 481 # 3 = default (sleep + save to disk, safe) 482 # 25 = hibernate only (slowest, safest for battery) 483 sudo pmset -a hibernatemode 0 484 ``` 485 486 ### Caffeinate (prevent sleep temporarily) 487 ```bash 488 # Prevent system from sleeping (Ctrl+C to stop) 489 caffeinate 490 491 # Prevent display from sleeping 492 caffeinate -d 493 494 # Prevent idle sleep 495 caffeinate -i 496 497 # Keep system awake for N seconds (e.g. 1 hour) 498 caffeinate -t 3600 499 500 # Keep system awake until a specific process finishes 501 caffeinate -w <PID> 502 ``` 503 504 --- 505 506 ## Network 507 508 ```bash 509 # Flush DNS cache 510 sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder 511 512 # List all network interfaces 513 networksetup -listallnetworkservices 514 515 # Turn Wi-Fi off / on 516 networksetup -setairportpower en0 off 517 networksetup -setairportpower en0 on 518 519 # Show current Wi-Fi SSID 520 networksetup -getairportnetwork en0 521 522 # Set DNS servers 523 sudo networksetup -setdnsservers Wi-Fi 1.1.1.1 8.8.8.8 524 525 # Show public IP address 526 curl ifconfig.me 527 528 # List open network connections 529 lsof -i 530 531 # List listening ports 532 sudo lsof -i -P | grep LISTEN 533 ``` 534 535 --- 536 537 ## Security & Privacy 538 539 ```bash 540 # Disable Gatekeeper quarantine warning ("App can't be opened") 541 defaults write com.apple.LaunchServices LSQuarantine -bool false 542 543 # Re-enable quarantine warning 544 defaults write com.apple.LaunchServices LSQuarantine -bool true 545 546 # Disable crash reporter dialog (reports still sent) 547 defaults write com.apple.CrashReporter DialogType -string "none" 548 549 # Re-enable crash reporter dialog 550 defaults write com.apple.CrashReporter DialogType -string "crashreport" 551 552 # Set a custom login window message 553 sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText "Property of [Your Name] — [phone number]" 554 555 # Remove login window message 556 sudo defaults delete /Library/Preferences/com.apple.loginwindow LoginwindowText 557 558 # Show/enable firewall 559 sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on 560 561 # Check SIP status 562 csrutil status 563 ``` 564 565 --- 566 567 ## Activity Monitor 568 569 ```bash 570 # Set update frequency: 0=very often(0.5s), 1=often(1s), 2=normal(2s), 3=rarely(5s) 571 defaults write com.apple.ActivityMonitor UpdatePeriod -int 1 572 573 # Set Dock icon to show: 574 # 0=App Icon, 2=Network Usage, 3=Disk Activity, 4=CPU Usage, 5=CPU History 575 defaults write com.apple.ActivityMonitor IconType -int 5 576 577 # Show all processes (not just user's) 578 defaults write com.apple.ActivityMonitor ShowCategory -int 0 579 ``` 580 581 --- 582 583 ## Time Machine 584 585 ```bash 586 # Disable Time Machine prompt when connecting new drives 587 defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true 588 589 # Disable local Time Machine backups (snapshots) 590 sudo tmutil disablelocal 591 592 # Enable local Time Machine backups 593 sudo tmutil enablelocal 594 595 # List all Time Machine snapshots 596 tmutil listlocalsnapshots / 597 598 # Delete a specific snapshot 599 tmutil deletelocalsnapshots <YYYY-MM-DD-HHMMSS> 600 ``` 601 602 --- 603 604 ## Launchpad 605 606 ```bash 607 # Reset Launchpad layout to default 608 defaults write com.apple.dock ResetLaunchPad -bool true; killall Dock 609 610 # Speed up Launchpad open animation 611 defaults write com.apple.dock springboard-show-duration -float 0.1; killall Dock 612 613 # Speed up Launchpad close animation 614 defaults write com.apple.dock springboard-hide-duration -float 0.1; killall Dock 615 616 # Speed up Launchpad page-flip animation 617 defaults write com.apple.dock springboard-page-duration -float 0.15; killall Dock 618 619 # Change Launchpad grid layout (columns x rows) 620 defaults write com.apple.dock springboard-columns -int 8; killall Dock 621 defaults write com.apple.dock springboard-rows -int 6; killall Dock 622 ``` 623 624 --- 625 626 ## Hot Corners Reference 627 628 > **Command format —** `defaults write com.apple.dock wvous-XX-corner -int [ACTION]` and `defaults write com.apple.dock wvous-XX-modifier -int [MODIFIER]`, then `killall Dock`. Replace `XX` with: `tl` (top-left), `tr` (top-right), `bl` (bottom-left), `br` (bottom-right). 629 630 ### Action Values 631 632 | Value | Action | 633 | --- | --- | 634 | `0` | Disabled / No-op | 635 | `2` | Mission Control | 636 | `3` | Application Windows | 637 | `4` | Desktop | 638 | `5` | Start Screen Saver | 639 | `6` | Disable Screen Saver | 640 | `10` | Put Display to Sleep | 641 | `11` | Launchpad | 642 | `12` | Notification Centre | 643 | `13` | Lock Screen | 644 645 ### Modifier Values 646 647 | Value | Modifier Key | 648 | --- | --- | 649 | `0` | None | 650 | `131072` | Shift | 651 | `262144` | Control | 652 | `524288` | Option | 653 | `1048576` | Command | 654 655 ### Example: Bottom-Right → Lock Screen (no modifier) 656 ```bash 657 defaults write com.apple.dock wvous-br-corner -int 13 658 defaults write com.apple.dock wvous-br-modifier -int 0 659 killall Dock 660 ``` 661 662 ### Example: Top-Left → Mission Control with Shift held 663 ```bash 664 defaults write com.apple.dock wvous-tl-corner -int 2 665 defaults write com.apple.dock wvous-tl-modifier -int 131072 666 killall Dock 667 ``` 668 669 --- 670 671 ## Miscellaneous System 672 673 ### System UI & Menu Bar 674 ```bash 675 # Show battery percentage in menu bar 676 defaults -currentHost write com.apple.controlcenter BatteryShowPercentage -bool true; killall SystemUIServer 677 678 # Show Bluetooth in menu bar 679 defaults -currentHost write com.apple.controlcenter Bluetooth -int 18; killall SystemUIServer 680 681 # Expand save dialog by default 682 defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true 683 684 # Disable "Application Downloaded from Internet" warning 685 defaults write com.apple.LaunchServices LSQuarantine -bool false 686 ``` 687 688 ### Terminal 689 ```bash 690 # Only allow UTF-8 in Terminal.app 691 defaults write com.apple.terminal StringEncodings -array 4 692 693 # Disable the "Are you sure you want to quit Terminal?" prompt 694 defaults write com.apple.terminal QuitTabText -bool false 695 ``` 696 697 ### App Behaviour 698 ```bash 699 # Prevent apps from being automatically terminated when idle 700 defaults write NSGlobalDomain NSDisableAutomaticTermination -bool true 701 702 # Resume apps on launch (keep windows from last session) 703 defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -bool true 704 705 # Auto-quit printer app when print jobs complete 706 defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true 707 ``` 708 709 ### Disk Utility 710 ```bash 711 # Enable Disk Utility debug menu 712 defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool true 713 714 # Show all partitions in Disk Utility 715 defaults write com.apple.DiskUtility advanced-image-options -bool true 716 ``` 717 718 ### Quick Look 719 ```bash 720 # Enable text selection in Quick Look 721 defaults write com.apple.finder QLEnableTextSelection -bool true; killall Finder 722 ``` 723 724 ### App Store 725 ```bash 726 # Enable WebKit Developer Tools in App Store 727 defaults write com.apple.appstore WebKitDeveloperExtras -bool true 728 729 # Enable debug menu in App Store 730 defaults write com.apple.appstore ShowDebugMenu -bool true 731 ``` 732 733 --- 734 735 ## Quick Resets 736 737 ```bash 738 # Restart Dock (apply most Dock changes) 739 killall Dock 740 741 # Restart Finder (apply most Finder changes) 742 killall Finder 743 744 # Restart SystemUIServer (apply menu bar changes) 745 killall SystemUIServer 746 747 # Restart ControlCenter (macOS 11+) 748 killall ControlCenter 749 750 # Read a specific preference to check its current value 751 defaults read com.apple.dock autohide-delay 752 753 # List ALL preferences for an app 754 defaults read com.apple.finder 755 756 # Delete a single preference key (restore default) 757 defaults delete com.apple.dock autohide-delay; killall Dock 758 ``` 759 760 --- 761 762 *Sources: mathiasbynens/dotfiles, macos-defaults.com, robservatory.com, sickcodes gist.*