Sub topic 13
Change capture defaults with the defaults command
The Screenshot toolbar covers the common settings. A few options appear only in the preferences file that the capture tools read: the file-name prefix, whether the date is included, the window shadow, and the floating thumbnail. The defaults command in Terminal reads and writes that file.
This chapter assumes you can open Terminal and run a command. It also assumes you know the capture shortcuts from earlier chapters and have read the screencapture chapter. You don't need any scripting experience.
What the defaults command does
macOS apps store their settings in preference files called property lists. The defaults command reads and writes those files from Terminal. Each app or system component has a domain, which is a name that identifies its preferences. The domain for screen capture is com.apple.screencapture.
The command has four verbs you will use:
| Verb | What it does |
|---|---|
| `defaults read com.apple.screencapture` | Prints every setting you have changed in that domain |
| `defaults read com.apple.screencapture type` | Prints one key |
| `defaults write com.apple.screencapture KEY VALUE` | Sets a key |
| `defaults delete com.apple.screencapture KEY` | Removes your override, so macOS uses its built-in default |
A key that was never written has no value in the file. Reading it produces an error that says the pair does not exist. That is normal. It means the built-in default applies.
defaults read com.apple.screencapture
defaults read com.apple.screencapture locationThe first command may print nothing useful or an error on a fresh Mac. The second prints a folder path if you have ever changed the save location, including through the toolbar's Options menu.
Why you must restart SystemUIServer
The system process SystemUIServer handles the capture shortcuts. It reads the preferences when it starts and may keep using cached values after that. After changing a key, restart the process so the next capture uses the new value:
killall SystemUIServerThis is safe. The menu bar flickers for a moment and then comes back. You don't lose any open windows or documents.
Change the save location
By default, captures go to the Desktop. To use a different folder, create it first and then point the location key at it:
mkdir -p ~/Pictures/Screenshots
defaults write com.apple.screencapture location ~/Pictures/Screenshots
killall SystemUIServerThree details matter here:
- The shell expands
~to your home folder beforedefaultssees it, so the stored value is a full path such as/Users/sam/Pictures/Screenshots. - The folder must exist. If it doesn't, captures can fall back to the Desktop or fail silently, which is a common cause of "my screenshots vanished".
- If the path contains spaces, put it in quotes:
"$HOME/Pictures/My Shots".
The location you set here is the same one the Screenshot toolbar shows under Options. Changing it in either place changes both.
Change the image format
Screenshots are PNG files by default. PNG is lossless, so text and interface edges stay sharp, but files can be large. To save JPEG files instead:
defaults write com.apple.screencapture type jpg
killall SystemUIServerCommon values for type are png, jpg, pdf, tiff, and gif. Use lowercase and no leading dot. If you set a value macOS does not recognize, it generally falls back to PNG, so check the file extension of your next capture to confirm the change worked.
Pick a format for the job:
| Format | Good for | Trade-off |
|---|---|---|
| `png` | Interface captures, text, diagrams | Larger files for photographic content |
| `jpg` | Photos, sharing where size matters | Lossy, so text edges blur slightly |
| `pdf` | Documents you want to print or annotate | Not widely supported in image editors |
| `tiff` | Archiving, print workflows | Very large files |
Screen recordings are not affected by type. They are always saved as .mov files.
Rename captures
Captures are named like Screenshot 2026-11-27 at 12.16.09.png. Two keys control the name.
The name key replaces the word "Screenshot":
defaults write com.apple.screencapture name "Capture"
killall SystemUIServerNew files are then named Capture 2026-11-27 at 12.16.09.png. A custom prefix helps when you search Finder or Spotlight for your own captures and want to exclude other images.
The include-date key controls the timestamp. It takes a Boolean value, which is true or false:
defaults write com.apple.screencapture include-date -bool false
killall SystemUIServerWithout the date, every capture has the same base name. macOS avoids overwriting files, but behavior can vary between versions, so take two captures and check the folder before you rely on this. The timestamp also sorts files in order of creation, which is useful, so most people leave it on.
Note the -bool flag. Without it, defaults stores the text "false" as a string, and the setting may be ignored.
Remove the window shadow
A window capture (Shift-Command-4, then Space, then click) includes a soft drop shadow and some transparent padding. That looks good in blog posts but adds extra space in documentation. To remove it:
defaults write com.apple.screencapture disable-shadow -bool true
killall SystemUIServerThis affects only window captures. You can also hold Option while clicking a window to skip the shadow for a single capture, which is better if you only need it occasionally.
Turn off the floating thumbnail
After each capture, a thumbnail appears in the corner of the screen for a few seconds. It lets you open Markup or drag the image into a document. The file is only written after the thumbnail disappears, unless you click it away. If you take many captures in a row, the thumbnail can be a nuisance:
defaults write com.apple.screencapture show-thumbnail -bool false
killall SystemUIServerWith the thumbnail off, the file is saved immediately, and you lose the quick Markup shortcut. The toolbar's Options menu has a "Show Floating Thumbnail" item that does the same thing, so you may prefer to toggle it there.
Undo a change
Because defaults write stores an override, you can return to the built-in behavior by deleting the key. This is safer than writing the old value back, because it leaves no stale override in the file:
defaults delete com.apple.screencapture type
defaults delete com.apple.screencapture name
defaults delete com.apple.screencapture include-date
defaults delete com.apple.screencapture disable-shadow
defaults delete com.apple.screencapture show-thumbnail
defaults delete com.apple.screencapture location
killall SystemUIServerIf a key was never set, defaults delete prints an error that the pair does not exist. That error is harmless.
Combine changes in one script
If you set up several Macs or want a repeatable setup, put the commands in a script. This one checks that the folder exists before it writes anything:
#!/bin/bash
set -e
DEST="$HOME/Pictures/Screenshots"
mkdir -p "$DEST"
defaults write com.apple.screencapture location "$DEST"
defaults write com.apple.screencapture type png
defaults write com.apple.screencapture name "Capture"
defaults write com.apple.screencapture show-thumbnail -bool true
killall SystemUIServer
echo "Capture settings applied. Current values:"
defaults read com.apple.screencaptureSave it as capture-setup.sh, run chmod +x capture-setup.sh, and then run ./capture-setup.sh. You can run it again at any time, because each write replaces the previous value.
Common errors
- Nothing changed. You probably skipped
killall SystemUIServer, or you made a typo in the key name. Key names are case sensitive and use hyphens, for exampleinclude-dateand notincludeDate. - Captures still go to the Desktop. The folder does not exist, or the path is wrong. Run
defaults read com.apple.screencapture locationand thenlson that path. - A Boolean setting was ignored. You wrote
truewithout-bool. Run the write again with the flag. - The location is a network or external drive. If the drive is not mounted when you capture, the save can fail. Use an internal folder and move files later.
Summary
The com.apple.screencapture domain holds the settings for the capture tools. Use read to inspect it, write to change a key, delete to restore a built-in default, and killall SystemUIServer to apply the change. Pass -bool for true or false values, and make sure a save folder exists before you point location at it.
Exercise
You ran defaults write com.apple.screencapture type jpg, but your next screenshot was still saved as a PNG. Name two likely causes and how to check each.
Show answer
First, SystemUIServer was not restarted, so run killall SystemUIServer and capture again. Second, the key may have been mistyped or written in the wrong domain, so run defaults read com.apple.screencapture type and confirm it prints jpg. If the value is correct and the process was restarted, check the file extension of a new capture rather than an older one.
Exercise
Write the commands to save screenshots into a new folder named Work Shots inside your Pictures folder, with no window shadow, and then apply the change.
Show answer
mkdir -p "$HOME/Pictures/Work Shots"
defaults write com.apple.screencapture location "$HOME/Pictures/Work Shots"
defaults write com.apple.screencapture disable-shadow -bool true
killall SystemUIServer
The quotes are needed because of the space in the folder name, and -bool true stores a real Boolean value.