Terminal is one of the most powerful macOS apps, which allows you to perform actions with different commands. Although Terminal Commands are seemingly difficult to carry out, believe me, they aren’t. Once you know the commands, you can quickly perform tasks like shutting down your Mac or copying contents from one place to another right from your terminal
As the terminal is a CLI (Command Line Interface), the language we type in which interacts with the Mac, is known as bash, and commands are called bash commands. This tool is often overlooked because it is completely different from the GUI (Graphical User Interface ), which provides a rich interface. But today I’ve come up with a useful list of macOS Terminal Commands that you can learn easily and will help you do things instantly. So let’s start.
11 Cool Terminal Commands for macOS – Mac User Should Try
Sep 28, 2017 These games are inbuilt in macOS and only can be accessible with Terminal. Steps To Play Game in macOS Terminal: 1. Open Terminal 2. Press ESC Key 4. Type game name i. At GameHouse, you'll easily find a Hidden Object game worthy of your time. These easy to play and entertaining games are an all-time favorite among players everywhere. From classic hidden object fun with games like Pure Hidden and the Vacation Adventures series to more adventurous games like Ghosts of the Past - Bones of Meadows Town and New.
#1. Hide/Unhide and View Files/Folders in Finder
macOS Terminal provides you an easy way to Hide, Unhide or View hidden files in the Finder via Terminal.
Open up the terminal from /Applications/finder or alternatively launch it from Spotlight.
To Hide any File/Folder:
Type in the following command :
Now, drag the file which you want to hide in the terminal and click Enter.
To View Hidden File/Folder:
Type defaults write com.apple.finder AppleShowAllFiles -bool TRUE in the Terminal.
Once done you need to restart the Finder, it can be done by this command.
If you ever wish to hide the sensitive files again, repeat all the commands by replacing TRUE with FALSE.
To Unhide any File/Folder:
Unhiding the file/folder is fairly easy, just replace “hidden” with “nohidden”.
Now, drag the file/folder which you want to unhide.
#2. Download Files Using Terminal
If you’ve a direct link of the file which you want to download, you can use the following commands to download the file using the Terminal on Mac.
Note: If you want to download the contents to any other directory replace “downloads” with the directory name.
#3. Keep your Mac Awake
To prevent the mac from sleep, or showing screensaver after some inactivity use
If you want this command to get auto-disabled after a certain period of time, put the -t flag and specify the time in seconds as shown below.
Here, after 150000 seconds the command will get disabled, and the settings will be restored. Meanwhile, you can also use Cmd + C to terminate the command.
#4. Change Default Screenshot Format Type
By default, the screenshots are saved in .PNG format, but you can gain full control over the screenshots behavior.
To change default screenshot format type, use defaults write com.apple.screencapture type followed by type for e.g. : ( PNG, JPG, GIF, or PDF), then press Enter.
#5. Access iCloud Drive Using Terminal
To access the data from your iCloud Drive use the following command.
However, we already have a detailed guide on how you can access, copy, or move data to your iCloud Drive, which you can check out anytime.
#6. Shut Down or Restart Mac using Terminal
To shut down your mac with CLI (Command Line Interface) aka Terminal, use
Just as shut down, you can restart your Mac by
#7. View File Contents
To access the contents of any damaged or corrupted file, you can force the terminal to open it with this command.
Note: If you try to open an image file in the terminal, it will show some gibberish text.
#8. Speed Up Time Machine Backup
Whenever you’re updating the Mac to the new version, backup’s are assurity of your data and the easiest way to take a backup is to use Time Machine. But do you know? You can speed up time machine backup using the terminal by this command
#9. Add Spaces to your Dock
If you feel, your dock is crowded with a lot of apps. You can add up a little space between each app icon, here’s how.
Type:
and hit Return.
Once done, type:
and press Return again
#10. Copy Contents from One Folder to Another
Copying contents from one place to another is fairly easy with Terminal, Type in the following command
Replace original with the current directory, and new with the name of the directory to which you want to copy the contents.
#11. Make your Mac Say Anything you want
This is the coolest command that macOS provides, you can make your Mac say anything you want, by using the say command followed by the words.
say “hello, iGeeksblog”
Wrapping Up…
There are lots of bash commands available for macOS. However, these were some of them. Do give them a try, and make more out of your Mac.
You might also like to read:
Which command did you like the most? Share your views in the comment section.
Nikhil runs iGB’s official YouTube channel. He is the official lensman of iGB and GB’s small studio is Nikhil’s playground, where he does all wonders with his remarkable signature. When Nikhil is not in his studio, you may spot him in a gourmet restaurant, chomping his way through some delicious food. He is a great traveler, who can go for long drives in search of good food.
- https://www.igeeksblog.com/author/nikhil/How to Manage Website Settings in iOS 13 Safari on iPhone and iPad
- https://www.igeeksblog.com/author/nikhil/How to Fix 'iMessage Needs to Be Enabled to Send This Message' Issue
- https://www.igeeksblog.com/author/nikhil/
- https://www.igeeksblog.com/author/nikhil/How to Enable and Use Taptic Time on Apple Watch in watchOS 6
What is the Terminal?
Terminal is an application embedded with Mac OS X, inside the Utility folder. It is a text and command-based way to use the operating system.
That means, while using Terminal, you won’t require the help of mouse and graphic interface.
How to use Terminal on Mac?
There are a number of ways to open Terminal in your Mac. We give you two of the easiest of them:
Open Terminal using Finder:
Step 1: Open Finder.
Step 2: Click on Go, then on Utilities from the menu bar.
Step 3: The Utility folder would open. Find the tab Terminal and click on it.
Open Terminal Using Siri:
One of the simplest ways to open Terminal window in Mac.
Step 1: Open Siri from Applications folder, or you can also click on the Siri button on the menu bar.
Step 2: Just use your microphone and say “Open Terminal.”
What are Some Fun Mac Terminal Commands?
1. Play Retro Games
Raise both of your hands if you love games like Tetris, Pong, and Snake. I mean, who doesn’t? Right?
What if I tell you that you can play these games on your Mac (not high quality obviously) just using some basic commands?
You’d scream in joy, right?
The command you need to enter is:
If you want to launch a game like Tetris or Pong, you need to first press Escape key, and then release it once you see this screen:
Hit the “x” key now, and an “M-x” prompt will be there at the bottom. To launch the game, type “tetris” or “pong” in it, and press Return.
2. Don’t Let Your Mac Fall Asleep
It happens a lot of times that we leave our Mac unattended for a few minutes, and it falls asleep. What if there was a way to stop it from happening?
Well, there is one way. There is a cool Mac Terminal command for it.
This is the basic formula:
So if you wanted to keep your Mac awake for an hour, then you’ll need to enter:
Turns out it’s not only us human beings who survive on the superpower of caffeine to stay awake. Mac needs some caffeine too.
3. Generate an Instant Calendar
Sometimes we want to plan our schedules and all we need is a calendar in front of us. And what do you know, Mac Terminal gives that too.
Just enter this command to get an instant calendar displayed on the Terminal Window:
Just change mm and yyyy to the month and year you want respectively.
4. Convert Text File into Audiobook
Audiobooks are definitely the new trend in the reading circles. Everyone seems to love them.
And Mac Terminal seems to support this cause. With just one simple command, you can convert any text file into an audiobook, complete with proper pauses at punctuation marks. The command is:
Hidden Mac Terminal Games Free Online Games
5. Convert Audio File to iPhone Ringtone
iPhones use .m4r format for ringtones. That means to have your favorite .mp3 file set as a ringtone, you’ll first need to convert it in the said .m4r format. And luckily, you can do this by taking a leaf out of Mac Terminal commands cheat sheet.
This would convert the input .mp3 file and will save it with the name, “ringtone.m4r”.
6. Enable Single Application Mode
Multitasking is good, but only to a limit. Having many apps on a small screen can distract you and your efficiency of working, hence you should have only one application in action at a time. With this mode enabled, all other open apps will be hidden.
Hidden Mac Terminal Games Launcher
Enter the following command in Terminal window:
To disable the mode, add FALSE in the same command:
7. Download Files Without Operating a Browser
You can also download your files without using a web browser on Mac terminal. All you need to know is the location of the file. This would actually ensure safety from malware and viruses that might exist in browsers. There are two commands:
One to set the location of Terminal to Downloads folder:
The other that would actually download the file:
Hidden Mac Terminal Games Free Online Games
8. Convert Files into HTML
If you have a .txt, .rtf or a .doc/.docx file and you want to convert it into the html format, you can easily do so by this command:
Hidden Mac Terminal Games Offline
You need to replace “file.ext” with the link of the file you wish to convert.
Hidden Mac Terminal Games Unblocked
And this is how you can enable fun Mac Terminal commands and enjoy the whole experience.
Hidden Mac Terminal Games Download
If you have any favorites that we haven’t shared here, let us know in the comments below.