How to change the screenshots save file location in MacOS X

I know how to capture my whole screen or just part of it. The screenshot is automatically saved to my desktop, and it is cluttering the entire desktop with .png screenshot files. How can I change where screenshots are saved on my MacOS X system instead of the default desktop location?

You can easily take a screenshot of your whole screen by pressing Shift-Command3 keys. By default, the screenshot saved as a .png file on your desktop. You can press Shift-Command4 to take a screenshot of a window. Then Space, and then clicking the window you want to capture. Again, the screenshot saved as a .png file on your desktop.

How to change screenshot save location

The steps are as follows:

Step 1: Open the terminal Application

Press CommandSpace to open Spotlight and type terminal

Step 2: Use defaults command to change screenshot file location

The syntax is:

defaults write location /path/to/save/screenshots/
killall SystemUIServer

To save the screenshots in $HOME/screenshots/ folder, enter:

mkdir $HOME/screenshots/
defaults write location $HOME/screenshots/
killall SystemUIServer

Sample outputs:

Fig.01: How to Change Where Screen Shots Save on MacOS X

Step 3: Verify it

Now take screenshot as described above and you should see the screenshots saved in $HOME/screenshots/ location:
$ ls $HOME/screenshots/
-rw-r--r--@ 1 veryv staff 82674 Jan 3 22:23 Screen Shot 2017-01-03 at 10.23.27 PM.png

How do I revert back to original settings?

Type the following two commands to save back the screenshots in ~/Desktop/, enter:

defaults write location ~/Desktop/
killall SystemUIServer

Tip: Change file name of screen shots on MacOS X

By default, screen shots taken in MacOS X save to files prefixed with “Screen Shot” in the file name. You can change file name prefix something else. The syntax is as follows:

defaults write name "nixCraft"
killall SystemUIServe
ls ~/screenshots/

Sample outputs:

nixCraft 2017-01-03 at 10.32.37 PM.png

You can revert back to original prefix by typing the following two commands:

defaults write name "Screen Shot"
killall SystemUIServe

And there, you have it. No more desktops cluttered with images on MacOS.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 1 comment so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
1 comment… add one
  • mohammed azfar Jan 4, 2017 @ 3:08

    Very Good Tips.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum