4 Cool Mac Terminal Tips to Make You More Productive

Mac Terminal Tips Productivity

For Mac users, OS X Mavericks packs a ton of cool features that were not available before, like Maps, App Nap and Notification Center to name just a few of them. Despite how capable Mavericks is though, it still lacks some functionalities that some would consider essential.

Considering that, let’s use this entry to find out about a few really cool features that you can enable using the Terminal app to supercharge your productivity on your Mac.

Note: If you are unfamiliar with Terminal, here’s a great article on how to get started with this incredibly useful Mac tool.

Ready? Here you have them.

1. Select Text Right From the QuickLook Preview Window

I’m sure this has happened to you before: There’s a text file or document that has some important information you need, so you scroll through several ones using QuickLook until you find it. But once you do, instead of just getting the important data you need right away, you have to open the file using a native app and then find the piece of info all over again to copy it to your clipboard.

Text In Preview

Using these commands on Terminal (in the order they are shown), you can forget about that issue and just select and copy text right from the QuickLook window when previewing any text file as shown in the image above.

First, the command to enable this feature:

defaults write -g QLEnableTextSelection -bool true

and then, a command to restart the Finder for the changes to take effect:

killall Finder

2. Prevent the Preview and Quicktime Apps From Auto-Restoring Your Last Open File

This particular behavior of these two apps can be quite troublesome depending on the circumstances, especially if you use your Mac both at work and at home, since if you open Preview or Quicktime at work, these apps will also open the document or video you had been viewing previously.

Preview Two Open Files

And while there is no way to change this permanently through the apps’ settings, you can use these Terminal commands to do so.

For Quicktime:

defaults write com.apple.QuickTimePlayerX NSQuitAlwaysKeepsWindows -bool false

For Preview

defaults write com.apple.Preview NSQuitAlwaysKeepsWindows -bool false

3. Prevent Your Mac From Sleeping

Sleeping prevents you Mac from wasting energy and resources when you are not using it. But for those occasions when you want to keep it running even if you are not sitting in front of it, use this Terminal code.

caffeinate -t 7200

…where the 7200 represent the number of seconds you want your Mac to remain awake (2 hours in this case). So feel free to change that for any other number that better suits your needs.

4. Change the Location Where Your Screenshots Are Stored

By default, all the screenshots you take on your Mac are stored on your desktop. This behavior, while convenient, can get your desktop cluttered in no time if you take a decent amount of screenshots in a short span of time.

To change that, use this Terminal command replacing the ZZZ with the location of the folder you want your screenshots to reside from now onwards:

defaults write com.apple.screencapture location ZZZ

Terminal Command

Cool Tip: Instead of typing all the path to the new target folder, simply drag it to the Terminal window right after the word ‘location’ in the command

There you have them. With just a little knowledge of Terminal you can now save tons of time and get things done more efficiently on your Mac. Enjoy!

Top image credit: blakespot

Last updated on 23 February, 2022

The above article may contain affiliate links which help support Guiding Tech. However, it does not affect our editorial integrity. The content remains unbiased and authentic.