Skip to content

rockyluke/macos-tips

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

82 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

macos-tips

  1. Disclaimer
  2. Crash Reporter
  3. Dashboard
  4. Disks
  5. DNS
  6. Dock
  7. Finder
  8. Homebrew
  9. Hostname
  10. Launchpad
  11. Locate
  12. Metadata
  13. Notifications
  14. Photos
  15. Preview
  16. Screen capture
  17. Software update
  18. Spotlight
  19. System Integrity Protection
  20. Miscellaneous

Disclaimer

Please read carefully the manual before using any commands on macsOS.

man man
man csrutil
man scutil
man sudo
man defaults

Crash Reporter

Disable Crash Reporter

defaults write com.apple.CrashReporter DialogType -string 'none'

Show Crash Reporter in Notifications

defaults write com.apple.CrashReporter UseUNC -bool true

Dashboard

Disable Dashboard

defaults write com.apple.Dashboard mcx-disabled -boolean true

Disks

man diskutil
man fs_usage
man hdiutil
man pmset
man tmutil

Disable Sudden Motion Sensor (SMS) for SSD

Read this (french) article to understand SMS.

pmset -a sms 0

Disable local Time Machine snapshots

tmutil disablelocal

DNS

Flush dns cache

dscacheutil -flushcache

Dock

Docker

Automaticaly hide and show the Dock (true / false)

defaults write com.apple.Dock autohide -bool true

Automaticaly hide and show the Dock time (in ms)

defaults write com.apple.Dock autohide-delay -float 0

Automaticaly hide and show the Dock delay (in ms)

defaults write com.apple.Dock autohide-time-modifier -float 0

Animame opening application (true / false)

defaults write com.apple.Dock launchanim -bool false

Minimize windows using (genie / scale)

defaults write com.apple.Dock mineffect -string "genie"

Minimize windows into application icon (true / false)

defaults write com.apple.Dock minimize-to-application -bool true

Show indicators for open applications (true / false)

defaults write com.apple.Dock show-process-indicators -bool true

Finder

man chflags

Show folder

chflags nohidden ~/Library

Hide folder

chflags hidden ~/Public

Show hidden files

defaults write com.apple.Finder AppleShowAllFiles -bool true

Show absolute path in title

defaults write com.apple.Finder _FXShowPosixPathInTitle -bool true

Show 'Path Bar'

defaults write com.apple.Finder ShowPathbar -bool true

Show 'Status Bar'

defaults write com.apple.Finder ShowStatusBar -bool true

Disable file extension change warning

defaults write com.apple.Finder FXEnableExtensionChangeWarning -bool false

Expand save panel by default

defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true

Expand print panel by default

defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true

Save to disk instead of iCloud by default

defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false

Show all extensions

defaults write NSGlobalDomain AppleShowAllExtensions -bool true

Disable smart quotes

defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false

Disable smart dashes

defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false

Show scrollbars

Choose between : 'WhenScrolling', 'Automatic' or 'Always'

defaults write NSGlobalDomain AppleShowScrollBars -string 'Always'

Homebrew

Homepage: brew.sh

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew upgrade
brew tap rockyluke/devops
brew upgrade

Hostname

scutil --set ComputerName <HOSTNAME>
scutil --set HostName <HOSTNAME>
scutil --set LocalHostName <HOSTNAME>

Launchpad

Reset to default order

defaults write com.apple.dock ResetLaunchPad -bool true
killall Dock

Locate

man launchctl

Enable locate

launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist

Metadata

Read this (french) article to understand .DS_Store.

Disable the creation of .DS_Store on network volumes

defaults write com.apple.DesktopServices DSDontWriteNetworkStores true

Disable the creation of .DS_Store on USB volumes

defaults write com.apple.DesktopServices DSDontWriteUSBStores true

Notifications

Disable Notifications

launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist

Photos

Disable automatic opening

defaults write com.apple.ImageCapture disableHotPlug -bool true

Preview

Disable auto-restore

defaults write com.apple.Preview NSQuitAlwaysKeepsWindows -bool false

Screen capture

Change the location of the screenshot

macOS 10

defaults write com.apple.ScreenCapture location -string "${HOME}/Documents/Screenshots"

macOS 11+

defaults write com.apple.screencapture location ${HOME}/Documents/Screenshots

Change the format of the screenshot

macOS 10

defaults write com.apple.ScreenCapture type -string "jpg"

macOS 11+

defaults write com.apple.ScreenCapture type png

Disable shadow in screenshot

defaults write com.apple.ScreenCapture disable-shadow -bool true

Software update

man softwareupdate

List software updates

softwareupdate --list

Install software updates

softwareupdate --install --all

Check software update daily

defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1

Spotlight

man mdutil

Rebuild database

mdutil -E /path/to/volume

Disable indexing of a volume

mdutil -i off /path/to/volume

Enable indexing of a volume

mdutil -i on /path/to/volume

System Integrity Protection

You need to understand [System Integrity Protection][sip-href] before continuing this section.

  • Power on your Mac and hold down the CMD + R keys to access the Recovery Partition.
  • From the Recovery Partition, click Utilities from the menu bar, and then select Terminal.
  • Enter the following command into Terminal and press Enter to execute it:
csrutil disable
  • Once the command has executed, exit the Terminal and reboot. When you log back into macOS, SIP will be disabled.

Ubuntu

This is a very short version of this article.

hdiutil convert -format UDRW -o /path/to/target.img /path/to/ubuntu.iso
diskutil list
diskutil unmountDisk /dev/diskN
sudo dd if=/path/to/target.img of=/dev/rdiskN bs=1m
diskutil eject /dev/diskN

Miscellaneous

    β•šβŠ™ βŠ™β•
  β•šβ•(β–ˆβ–ˆβ–ˆ)═╝
 β•šβ•(β–ˆβ–ˆβ–ˆ)═╝
β•šβ•(β–ˆβ–ˆβ–ˆ)═╝
 β•šβ•(β–ˆβ–ˆβ–ˆ)═╝
  β•šβ•(β–ˆβ–ˆβ–ˆ)═╝
   β•šβ•(β–ˆβ–ˆβ–ˆ)═╝

About

🍏 macOS tips (mostly CLI).

Topics

Resources

License

Stars

Watchers

Forks

Languages