Terminal on Mac: How to access your Mac’s hidden command center

August 4, 2021

By Kim Komando

If you’ve used a Windows PC in the past, you might be familiar with the Command Prompt screen built into its operating system. While a bit outdated, it still exists in Windows 10.

Did you know that Mac has something similar? It’s called the Terminal, and it has some pretty nifty uses you might not be aware of. It’s also surprisingly easy to use. Tap or click here for five pro tips to get more out of your Mac.

If you are curious about how to use it, read on. Here’s how to access your Mac’s hidden command center and some useful commands for you to try in the future.

Finding command center

Even if you are familiar with Mac, you may not know where your command center is hidden. Thankfully, it’s easy enough to find:

Caffeinate

If you are running a program or importing or exporting data and want to avoid your Mac going to sleep, you can use the Terminal for that.

It’s a little-known command called caffeinate, just like giving your computer a quick cup of coffee. The command in Terminal allows you to say how long you can keep your computer from going to sleep. Do so by typing in this command:

caffeinate -u -t 3600

To exit, hit Control + C, and caffeinate will stop running.

RELATED: 10 Mac settings you should definitely be using

Clear DNS Cache

If you’ve ever heard of clearing your cache, that is what this command will help you do. It’s pretty simple to do using your Terminal:

If you have macOS 10.12 or later, use the following command:

sudo killall. -HUP mDNSResponder; sudo killall mDNSResponderHelper;sudo dscacheutil – flushcache

Once you’ve entered the command, you’ll be required to enter your admin password. After you do so, your cache will be cleared.

Force Shutdown

We’ve all run into a situation where you need to force shutdown your computer because it’s not operating the way you would like. If you can’t shut down your computer the normal way, you can do it with your Terminal. Type the following command:

shutdown -r now

Once you press enter, your computer will shut down.

Show/Hide/Hidden Files/Folders

No matter your situation, you most likely have files on your Mac that you want to keep private. Let’s go over how you can hide files and folders and see them again when needed.

How to hide files/folders:

Pro tip: You can also hide files or folders through the Terminal window by renaming the folder to start with a “.” (period). You can also hide file name extensions, although the process is different.

How to view hidden files/folders:

Now that the items you want to hide are hidden, at some point, you will want to view them again. Again, it’s a bit tricky, but here is how:

How to unhide a folder:

If you can’t remember the hidden folder’s path, you can drag and drop it into the Terminal window after typing chflags nohidden.

The Terminal can be a handy tool on Mac. Curious about Mac’s other hidden features? Here are 10 Mac settings you should definitely be using.

https://www.komando.com/news/macs-hidden-command-center/