Skip to content

Instantly share code, notes, and snippets.

@TommyPKeane
Last active March 9, 2023 16:40
Show Gist options
  • Save TommyPKeane/3c0e2b2f797b530099b2270b1dc06bc9 to your computer and use it in GitHub Desktop.
Save TommyPKeane/3c0e2b2f797b530099b2270b1dc06bc9 to your computer and use it in GitHub Desktop.
macOS System Commands in bash Syntax for troubleshooting or configuring a macOS System.
# Stop (and Resart) the macOS User Interface Runtime (Menubar, Dock, etc.)
killall SystemUIServer
# Stop (and Resart) Finder (the macOS File Explorer)
killall Finder
# Set Screenshot/Screencapture Format
# Options: "png", "bmp", "gif", "jpg", "pdf", "tiff"
# Apply changes with: `killall SystemUIServer`
defaults write com.apple.screencapture type -string "png"
# Change the Screenshot/Screencapture Directory
# Options: valid path (can include valid Environment Variables)
# Apply changes with: `killall SystemUIServer`
defaults write com.apple.screencapture location -string "$HOME/Pictures"
# CHANGE SCREENSHOT (CMD+SHFT+3) SAVE LOCATION (~ IS YOUR CURRENT USER FOLDER)
defaults write com.apple.screencapture location ~/Downloads/_NewScreenShots/;
killall SystemUIServer;
# SHOW HIDDEN FILES
defaults write com.apple.finder AppleShowAllFiles YES;
killall Finder;
# HIDE HIDDEN FILES
defaults write com.apple.finder AppleShowAllFiles NO;
killall Finder;
# TURN ON TEXT SELECTION IN QUICKLOOK (PRESS SPACE ON FILES IN FINDER)
defaults write com.apple.finder QLEnableTextSelection -bool TRUE;
killall Finder;
# TURN OFF TEXT SELECTION IN QUICKLOOK
defaults delete com.apple.finder QLEnableTextSelection;
killall Finder;
# CHANGE SYSTEM (COMPUTER) NAME
sudo -E scutil --set HostName NEW_COMPUTER_NAME;
# (restart terminal afterwards)
# RESTART FINDER (WIHOUT RESTARTING YOUR SYSTEM) IF IT IS FROZEN OR YOU CANNOT DELETE A STUBBORN FILE FROM THE TRASH
killall Finder;
# RESTART THE MENU BAR (WIHOUT RESTARTING YOUR SYSTEM) IF IT IS FROZEN OR DOING SOMETHING WEIRD
killall SystemUIServer;
# RESTART THE DOCK (WIHOUT RESTARTING YOUR SYSTEM) IF IT IS FROZEN OR DOING SOMETHING WEIRD
killall Dock;
# Enable or Disable the automated Drop-Shadow in Window Screenshots/Screencaptures
# Options: true, false
# Apply changes with: `killall SystemUIServer`
defaults write com.apple.screencapture disable-shadow -bool true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment