Skip to content

macOS defaults, Finder and CLI Tips Cheat Sheet

Quick-reference guide for changing hidden settings with defaults, tweaking Finder and the Dock, and everyday Terminal shortcuts on macOS.


macOS defaults, Finder & UI Tweaks

Show Hidden Dotfiles in Finder:

defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder

Show All File Extensions System-Wide:

defaults write NSGlobalDomain AppleShowAllExtensions -bool true && killall Finder

Show Status Bar and Path Bar in Finder:

defaults write com.apple.finder ShowStatusBar -bool true && defaults write com.apple.finder ShowPathbar -bool true && killall Finder

Display Full POSIX Path in Finder Window Title:

defaults write com.apple.finder _FXShowPosixPathInTitle -bool true && killall Finder

Default Finder Search Scope to Current Folder (Instead of "This Mac"):

defaults write com.apple.finder FXDefaultSearchScope -string "SCcf" && killall Finder

Keep Folders on Top When Sorting by Name in Finder:

defaults write com.apple.finder _FXSortFoldersFirst -bool true && killall Finder

Disable Warning When Changing a File Extension:

defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false && killall Finder

Prevent Creation of .DS_Store Files on Network (SMB/NFS) & USB Volumes:

defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true

Set Custom Screenshot Save Directory:

mkdir -p ~/Pictures/Screenshots && defaults write com.apple.screencapture location ~/Pictures/Screenshots && killall SystemUIServer

Disable Drop Shadows on Window Screenshots:

defaults write com.apple.screencapture disable-shadow -bool true && killall SystemUIServer

Change Screenshot Format (png, jpg, pdf, heic):

defaults write com.apple.screencapture type -string "png" && killall SystemUIServer

Speed Up Dock Auto-Hide & Remove Reveal Delay:

defaults write com.apple.dock autohide-delay -float 0 && defaults write com.apple.dock autohide-time-modifier -float 0.15 && killall Dock

Disable "Press and Hold" Accents in Favor of Fast Key Repeat (Essential for Vim/Terminal):

defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
defaults write NSGlobalDomain KeyRepeat -int 2
defaults write NSGlobalDomain InitialKeyRepeat -int 15

Daily CLI Productivity & Bridge Utilities

Copy Command Output Directly to macOS Clipboard (Pasteboard):

cat ~/.ssh/id_ed25519.pub | pbcopy

Paste Clipboard Contents into a File:

pbpaste > output.txt

Open Current Working Directory in Finder:

open .

Launch an Application or Pass a File to a Specific GUI Application:

open -a "Firefox" index.html

Search Files Instantly via Spotlight Metadata Index (mdfind):

mdfind "kMDItemDisplayName == '*config*'c"

Search Spotlight Content Within a Specific Directory:

mdfind -onlyin ~/Documents "security"

Inspect Spotlight Metadata Attributes of a File:

mdls [file_path]

Convert Property List (.plist) Files Between Binary and XML for Editing:

plutil -convert xml1 [file.plist]
plutil -convert binary1 [file.plist]

Validate .plist Syntax:

plutil -lint [file.plist]

Sources & Verification