Skip to main content

These Terminal commands will take your MacOS skills to the next level

MacOS Terminal Commands
Bill Roberson/Digital Trends
The MacOS Terminal can be pretty intimidating. It’s the kind of tool that can make anyone feel out of their depth. It lurks there in your Utilities folder beside all those other applications you only ever need to launch when there’s something seriously wrong with your Mac.

This application is a powerful tool that allows you to access the deepest recesses of your Mac and fiddle around with things that you may have thought were off limits. It’s frequently used by system admins and software developers, but it’s easy enough for the average person to use as well.

Recommended Videos

Let’s take a guided tour through the four most useful MacOS terminal commands, and how you can use them to tailor your MacOS High Sierra experience.

How to open the terminal

Image used with permission by copyright holder

This is probably the most important part of this guide since many people don’t know that the Terminal even exists. To open the Terminal, all you need to do is open your Finder, click on Applications there on the left sidebar, and then open the Utilities folder all the way at the bottom. The Terminal icon looks like a little black window, ready to take your commands. The icon is fitting because that’s exactly what the application does.

Terminal is an interface through which you do nothing more than issue text commands to your Mac. Once you issue a command, the Terminal will respond in one of three ways: recognize and accept those commands, not recognize them, or prompt you for further input. It’s that simple.

The commands below will help familiarize you with how the Terminal works, and what you can use it for in your everyday life.

Keep your Mac from sleeping

Full command: caffeinate -u -t 600  Image used with permission by copyright holder

This command accomplishes one very simple problem: keeping your computer awake for a period of time. Just open the Terminal and type in ‘caffeinate’ and your Mac or MacBook won’t go to sleep until you terminate that Terminal window. You can also set a timer, by typing ‘caffeinate -u -t’ then how long, in seconds, you want to prevent your Mac from sleeping.

The completed command would look something like this: ‘caffeine -u -t 120’ — and that’ll keep your Mac from sleeping for just two minutes.

Change screenshot formats

Full command: defaults write com.apple.screencapture type JPG Image used with permission by copyright holder

MacOS makes it really easy to capture screenshots of your whole screen (Command + Shift 3) or just part of your screen (Command + Shift +4). However, it always saves those screenshots to your desktop as PNG files. That’s not always a bad thing, but sometimes you just need a JPG. If you’re not sure why that matters, check out our breakdown of image filetypes for the full explanation.

This Terminal command can solve that problem. It allows you to change the filetype your screenshots will be saved as — in this example, we’ve used JPG which will make all your screenshots save as JPG files. You can change it back at any time by typing the above command but instead of JPG, type PNG.

Show detailed file paths

Full command: defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES Image used with permission by copyright holder

By default, when you open a folder in MacOS, the top of the window will show the name of the folder, but not where it is. For instance, open up your Pictures folder and the top of the finder window will just say Pictures, not ‘users/yourname/pictures.’ It’s not a problem, but it can be irritating, especially when you’re moving folders around or digging through folders trying to find a particular file.

This terminal command shows the full path of a folder in the Finder window of that folder. If nothing else it’s a helpful way to get an idea of how your files are arranged and keep your Mac nice and organized. Undoing this change is just as easy as typing out the above command again, and replacing YES with NO.

Show hidden files

Full command: defaults write com.apple.finder AppleShowAllFiles TRUE Image used with permission by copyright holder

Sometimes you just need to dig into the sensitive guts of MacOS to fix some problem or another, and that will require accessing files that your Mac would prefer you left alone. By default, most sensitive files and folders are hidden from view, including from Spotlight and Siri searches. With the right terminal command, you can peel back the curtain and peer into the darkest reaches of your Mac.

The above command un-hides all of your delicate system files. If you’d prefer those go back to being hidden, just re-enter the above command but swap TRUE with FALSE.

Jayce Wagner
Former Digital Trends Contributor
A staff writer for the Computing section, Jayce covers a little bit of everything -- hardware, gaming, and occasionally VR.
Best refurbished MacBook deals: Get a MacBook Air for $101 and more
A stack of MacBooks is pictured from the top down.

Apple is easily one of the best laptop brands that you're going to find, which often makes Apple MacBooks quite pricey, especially when you consider that the Apple brand adds a premium to the price tag. So, if you're in the Apple ecosystem and looking for the best laptops, you're going to get them, but you'll also have to pay a pretty penny for them. Luckily, you can grab yourself a refurbished laptop to save yourself a little bit of extra money, not to mention it's great for the environment since it reduces electronic waste.

To help you pick the best MacBook for your budget, we've gone out and picked some of the best refurbished MacBook deals we could find and compiled them below. Apple deals are notoriously slim pickings, so if you want a complete Apple suite for cheap, check out refurbished iPhone deals and refurbished iPad deals too.
MacBook Air 11.6-inch (2015) -- from $101

Read more
These M4 MacBook Pro leaks are getting insane, and I don’t know what to believe anymore
An open MacBook Pro on a table.

Apple has yet to announce an October Mac event, but leaks for the M4 MacBook Pro continue to circulate. A new tweet from Apple leaker ShrimpApplePro and a new Russian unboxing video have been spotted by Tom's Hardware, giving this possibly true and definitely unprecedented Apple leak more steam. The tweet claims a seller on a private Facebook group has 200 units of the M4 MacBook Pro for sale, adding: "This is probably the biggest warehouse leakage I've ever seen."

https://x.com/VNchocoTaco/status/1843133165302591861?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E1843133165302591861%7Ctwgr%5E3d007d4bc86ddf38301ce5446103d04c8e8215f5%7Ctwcon%5Es1_&ref_url=https%3A%2F%2Fwww.tomshardware.com%2Flaptops%2Fapple-macbook-pro-m4-leakage-gets-serious-with-200-units-reportedly-up-for-sale-on-social-media

Read more
A YouTuber with 11 million subscribers just unboxed the M4 MacBook Pro
The 14-inch MacBook Pro with M3 Max chip seen from behind.

Leaks of the yet-to-be-announced M4 MacBook Pro have been getting weirder and weirder lately. First, it was up for sale on Facebook. And now, as spotted by MacRumors, there seems to be an entire unboxing video of it on YouTube.

Weirder yet, Bloomberg's Mark Gurman retweeted the Russian YouTuber Wylsacom's video with the comment: "Unconfirmed but looks fairly legitimate." This isn't some unknown YouTube channel, either. He currently sits at 11.3 million subscribers.

Read more