{"id":24123072,"url":"https://github.com/rockyluke/macos-tips","last_synced_at":"2025-09-18T13:31:37.866Z","repository":{"id":184844312,"uuid":"51603249","full_name":"rockyluke/macos-tips","owner":"rockyluke","description":"🍏 macOS tips (mostly CLI).","archived":false,"fork":false,"pushed_at":"2023-11-19T10:21:00.000Z","size":107,"stargazers_count":25,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-12T13:29:08.494Z","etag":null,"topics":["apple","macos"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rockyluke.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-02-12T17:07:38.000Z","updated_at":"2025-03-20T22:09:23.000Z","dependencies_parsed_at":"2023-11-19T11:25:13.018Z","dependency_job_id":"a2788259-f2d3-4559-9067-dd3e8f811442","html_url":"https://github.com/rockyluke/macos-tips","commit_stats":null,"previous_names":["rockyluke/macos-tips"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rockyluke/macos-tips","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockyluke%2Fmacos-tips","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockyluke%2Fmacos-tips/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockyluke%2Fmacos-tips/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockyluke%2Fmacos-tips/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rockyluke","download_url":"https://codeload.github.com/rockyluke/macos-tips/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockyluke%2Fmacos-tips/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275774086,"owners_count":25526155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-18T02:00:09.552Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apple","macos"],"created_at":"2025-01-11T12:35:22.077Z","updated_at":"2025-09-18T13:31:37.610Z","avatar_url":"https://github.com/rockyluke.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# macos-tips\n\n1. [Disclaimer](#disclaimer)\n1. [Crash Reporter](#crash-reporter)\n1. [Dashboard](#dashboard)\n1. [Disks](#disks)\n1. [DNS](#dns)\n1. [Dock](#dock)\n1. [Finder](#finder)\n1. [Homebrew](#homebrew)\n1. [Hostname](#hostname)\n1. [Launchpad](#launchpad)\n1. [Locate](#locate)\n1. [Metadata](#metadata)\n1. [Notifications](#notifications)\n1. [Photos](#photos)\n1. [Preview](#preview)\n1. [Screen capture](#screen-capture)\n1. [Software update](#software-update)\n1. [Spotlight](#spotlight)\n1. [System Integrity Protection](#system-integrity-protection)\n1. [Miscellaneous](#miscellaneous)\n\n## Disclaimer\n\nPlease read carefully the manual before using any commands on macsOS.\n\n```bash\nman man\nman csrutil\nman scutil\nman sudo\nman defaults\n```\n\n## Crash Reporter\n\n### Disable Crash Reporter\n\n```bash\ndefaults write com.apple.CrashReporter DialogType -string 'none'\n```\n\n### Show Crash Reporter in Notifications\n\n```bash\ndefaults write com.apple.CrashReporter UseUNC -bool true\n```\n\n## Dashboard\n\n### Disable Dashboard\n\n```bash\ndefaults write com.apple.Dashboard mcx-disabled -boolean true\n```\n\n## Disks\n\n```bash\nman diskutil\nman fs_usage\nman hdiutil\nman pmset\nman tmutil\n```\n\n### Disable Sudden Motion Sensor (SMS) for SSD\n\nRead                 [this](https://en.wikipedia.org/wiki/Sudden_Motion_Sensor)\n([french](https://fr.wikipedia.org/wiki/Sudden_Motion_Sensor))    article    to\nunderstand SMS.\n\n```bash\npmset -a sms 0\n```\n\n### Disable local Time Machine snapshots\n\n```bash\ntmutil disablelocal\n```\n\n## DNS\n\n### Flush dns cache\n\n```bash\ndscacheutil -flushcache\n```\n\n## Dock\n\n![Docker][dock]\n\n### Automaticaly hide and show the Dock (true / false)\n\n```bash\ndefaults write com.apple.Dock autohide -bool true\n```\n\n### Automaticaly hide and show the Dock time (in ms)\n\n```bash\ndefaults write com.apple.Dock autohide-delay -float 0\n```\n\n### Automaticaly hide and show the Dock delay (in ms)\n\n```bash\ndefaults write com.apple.Dock autohide-time-modifier -float 0\n```\n\n### Animame opening application (true / false)\n\n```bash\ndefaults write com.apple.Dock launchanim -bool false\n```\n\n### Minimize windows using (genie / scale)\n\n```bash\ndefaults write com.apple.Dock mineffect -string \"genie\"\n```\n\n### Minimize windows into application icon (true / false)\n\n```bash\ndefaults write com.apple.Dock minimize-to-application -bool true\n```\n\n### Show indicators for open applications (true / false)\n\n```bash\ndefaults write com.apple.Dock show-process-indicators -bool true\n```\n\n## Finder\n\n```bash\nman chflags\n```\n\n### Show folder\n\n```bash\nchflags nohidden ~/Library\n```\n\n### Hide folder\n\n```bash\nchflags hidden ~/Public\n```\n\n### Show hidden files\n\n```bash\ndefaults write com.apple.Finder AppleShowAllFiles -bool true\n```\n\n### Show absolute path in title\n\n```bash\ndefaults write com.apple.Finder _FXShowPosixPathInTitle -bool true\n```\n\n### Show 'Path Bar'\n\n```bash\ndefaults write com.apple.Finder ShowPathbar -bool true\n```\n\n### Show 'Status Bar'\n\n```bash\ndefaults write com.apple.Finder ShowStatusBar -bool true\n```\n\n### Disable file extension change warning\n\n```bash\ndefaults write com.apple.Finder FXEnableExtensionChangeWarning -bool false\n```\n\n### Expand save panel by default\n\n```bash\ndefaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true\ndefaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true\n```\n\n### Expand print panel by default\n\n```bash\ndefaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true\ndefaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true\n```\n\n### Save to disk instead of iCloud by default\n\n```bash\ndefaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false\n```\n\n### Show all extensions\n\n```bash\ndefaults write NSGlobalDomain AppleShowAllExtensions -bool true\n```\n\n### Disable smart quotes\n\n```bash\ndefaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false\n```\n\n### Disable smart dashes\n\n```bash\ndefaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false\n```\n\n### Show scrollbars\n\nChoose between : 'WhenScrolling', 'Automatic' or 'Always'\n\n```bash\ndefaults write NSGlobalDomain AppleShowScrollBars -string 'Always'\n```\n\n## Homebrew\n\nHomepage: [brew.sh](http://brew.sh/)\n\n```bash\nruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"\nbrew upgrade\nbrew tap rockyluke/devops\nbrew upgrade\n```\n\n## Hostname\n\n```bash\nscutil --set ComputerName \u003cHOSTNAME\u003e\nscutil --set HostName \u003cHOSTNAME\u003e\nscutil --set LocalHostName \u003cHOSTNAME\u003e\n```\n\n## Launchpad\n\n### Reset to default order\n\n```bash\ndefaults write com.apple.dock ResetLaunchPad -bool true\nkillall Dock\n```\n\n## Locate\n\n```bash\nman launchctl\n```\n\n### Enable locate\n\n```bash\nlaunchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist\n```\n\n## Metadata\n\nRead                            [this](https://en.wikipedia.org/wiki/.DS_Store)\n([french](https://fr.wikipedia.org/wiki/.DS_Store))   article   to   understand\n.DS_Store.\n\n### Disable the creation of .DS_Store on network volumes\n\n```bash\ndefaults write com.apple.DesktopServices DSDontWriteNetworkStores true\n```\n\n### Disable the creation of .DS_Store on USB volumes\n\n```bash\ndefaults write com.apple.DesktopServices DSDontWriteUSBStores true\n```\n\n## Notifications\n\n### Disable Notifications\n\n```bash\nlaunchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist\n```\n\n## Photos\n\n### Disable automatic opening\n\n```bash\ndefaults write com.apple.ImageCapture disableHotPlug -bool true\n```\n\n## Preview\n\n### Disable auto-restore\n\n```bash\ndefaults write com.apple.Preview NSQuitAlwaysKeepsWindows -bool false\n```\n\n## Screen capture\n\n### Change the location of the screenshot\n\n#### macOS 10\n\n```bash\ndefaults write com.apple.ScreenCapture location -string \"${HOME}/Documents/Screenshots\"\n```\n\n#### macOS 11+\n\n```bash\ndefaults write com.apple.screencapture location ${HOME}/Documents/Screenshots\n``` \n\n### Change the format of the screenshot\n\n#### macOS 10\n\n```bash\ndefaults write com.apple.ScreenCapture type -string \"jpg\"\n```\n\n#### macOS 11+\n\n```bash\ndefaults write com.apple.ScreenCapture type png\n```\n\n### Disable shadow in screenshot\n\n```bash\ndefaults write com.apple.ScreenCapture disable-shadow -bool true\n```\n\n## Software update\n\n```bash\nman softwareupdate\n```\n\n### List software updates\n\n```bash\nsoftwareupdate --list\n```\n\n### Install software updates\n\n```bash\nsoftwareupdate --install --all\n```\n\n### Check software update daily\n\n```bash\ndefaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1\n```\n\n## Spotlight\n\n```bash\nman mdutil\n```\n\n### Rebuild database\n\n```bash\nmdutil -E /path/to/volume\n```\n\n### Disable indexing of a volume\n\n```bash\nmdutil -i off /path/to/volume\n```\n\n### Enable indexing of a volume\n\n```bash\nmdutil -i on /path/to/volume\n```\n\n## System Integrity Protection\n\nYou  need   to  understand   [System  Integrity   Protection][sip-href]  before\ncontinuing this section.\n\n- Power  on your  Mac and hold  down the CMD  + R  keys to access  the Recovery\n  Partition.\n- From  the Recovery  Partition, click  Utilities from the  menu bar,  and then\n  select Terminal.\n- Enter the following command into Terminal and press Enter to execute it:\n\n```bash\ncsrutil disable\n```\n\n- Once  the command has  executed, exit the Terminal  and reboot. When  you log\n  back into macOS, SIP will be disabled.\n\n## Ubuntu\n\nThis         is         a         very         short         version         of\n[this](http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-mac-osx)\narticle.\n\n```bash\nhdiutil convert -format UDRW -o /path/to/target.img /path/to/ubuntu.iso\ndiskutil list\ndiskutil unmountDisk /dev/diskN\nsudo dd if=/path/to/target.img of=/dev/rdiskN bs=1m\ndiskutil eject /dev/diskN\n```\n\n## Miscellaneous\n\n```\n    ╚⊙ ⊙╝\n  ╚═(███)═╝\n ╚═(███)═╝\n╚═(███)═╝\n ╚═(███)═╝\n  ╚═(███)═╝\n   ╚═(███)═╝\n```\n\n- [developer.apple.com/opensource](https://developer.apple.com/opensource/)\n- [github.com/apple](https://github.com/apple)\n- [www.apple.com/opensource](https://www.apple.com/opensource/)\n\n[dock]: images/Dock.png\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frockyluke%2Fmacos-tips","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frockyluke%2Fmacos-tips","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frockyluke%2Fmacos-tips/lists"}