The Terminal is a very powerful tool of macOS. It allows a user to input commands and gets some output as a result of those commands without having to use a mouse or navigating through a lot of places. It is a quick way of getting a response. The Terminal is a command-line interface, and you can say it is more powerful than a graphical user interface.
You need to know that using the Terminal is a very sensitive scenario, and most people are afraid to use it because they are not aware of the commands properly, and they are scared of messing up the system with one typo that can make things go wrong with the system.
Before we start off with the terminal commands, our sincere advice will be to the users is that, try to use the Terminal more seriously and effectively because it is the most powerful tool on a macOS. You can directly use mac commands to do anything instantly through the Terminal. Let’s start our discussion about the best terminal commands and their purposes.
Best Mac Terminal Commands
First, go to Terminal that is located in the Applications and then go to the utility folder, and then you can use your commands with the Mac. At the start, you will see:
This is a prompt where you can enter the commands and make Mac do whatever you want to. We will be using proper commands to identify how to enter commands by using a $ sign, and we will enter the commands followed by a $ sign. So let’s get this discussion started.
We are going to work on the basic and easy to understand commands that you can get to know easily and understand what they are used for. To start the Terminal and let’s get going with the commands and their functionalities.
Keeping Mac Awake Command
If we talk about apps, then there are many apps to use to disable the sleep function of your Mac, such as Amphetamine. But there are much easier ways if you think of, you can do this with a lot shorter and easier process by using commands in your Terminal. In order to put your Mac in a state where the sleep function stays off, you can use the following command with the Terminal.
This command will stop your Mac from going to sleep mode. And when you want your Mac to rest afterward, you can turn down your laptop or press the Ctrl + C button to revert its changes.
Downloading Files Without using Browser
If you are looking for a file to download from the internet, it’s not necessary that you use a browser to get it downloaded. Mac terminal has command for downloading a file from the internet, too, in which all you have to do is specify the folder in which you want that file to be downloaded in. It is set to be downloaded in the download folder by default. But you can also change it according to your choice. The access to download folder is
and after that, to download your file type, you need to type in the following command.
curl -O [and insert the URL of the file]
Checking the Server Command
Ping is a terminal command that is very useful that you can use on an everyday basis because it lets you check the response of domain or an IP address such as websites like Google to see how quickly and efficiently it takes the server to respond.
To perform Ping command, you will need to enter the following command in your Terminal:
You should remember that you can replace the URL with any of the website’s URL that you want to access, or you can use an IP address instead.
Showing Hidden Files and Folder
MacOS creates a lot of hidden files and folders for many reasons. And a normal user doesn’t know what files are being kept as hidden and why is that. But in case if you need to track any hidden file or folder, then you can do it easily with a terminal command. You can type.
“defaults write com.apple. Finder AppleShowAllFiles -bool TRUE” in the terminal command. And then type:
You can also change TRUE to FALSE when you want to hide those files again.
Copying Files from One Folder to Another
In the normal routine, a person uses drag and drop to copy any file or folder from one place to another. Terminal also has an easy command for this, too, and you can use it to easily place or move the file to a new location. This command is called the ditto command, and here’s how you can use it in Terminal.
Type the command: Ditto [original folder location] [new folder location]
In this command, the ‘original folder’ and ‘new folder’ are the paths of these files as the source and destination of the files. You can type “-v” to see each file’s name in the Terminal window as it is copied after Ditto.
Disabling Screenshot Drop Shadows
You may notice that when you take a screenshot of a window in OS X, then it shows a drop shadow by default, which also adds some wasted pixels to it. If you want to make your screenshots shadow-free, then you can use the following command for this purpose.
“$ defaults write com.apple.screen capture disable-shadow -bool TRUE.”
You can restart your Mac if you want to see the changes, or you can use another command right there to see instant changes that you made. Using a command like
$ killall SystemUIServer
It stops the graphical front-end to OS X for some time, and then it restarts instantly, and then you can take a screenshot to notice that the shadow doesn’t exist with the screenshot. And if you are thinking that this is not a good idea and you want to reverse the changes, you can use the following command.
“$ defaults write com.apple.screen capture disable-shadow -bool FALSE.”
$ killall SystemUIServer
Making your Mac say Things You Want
Mac can also say anything that you want it to say just by using terminal commands. With the right commands, you can help out your Mac to say things out loud. And you can use the “say” command in order to let your Mac speak. Then you have to add the command after the say command. For example.
say “Hi Sarge; Terminal says holla.”
When you type in this command in the Terminal, your Mac will exactly say the same sentence written in quotes with its default built in voice system.
Checking for Updates
Mac usually checks for updates on a weekly basis that is set as default. And it runs a scan on the apps on Mac App Store too. But you can change these settings too by using terminal commands for this purpose. If you want your Mac to check for updates on a daily basis, then you can enter the following command.
“defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1”
You can set the integer to the number of your choice, and it represents the number of days that your Mac will have to wait in order to check for the updates. And if you want to return back to the default weekly checking of updates, you can use the following command:
“defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 7.”
Enabling AirDrop on Mac
AirDrop is a great feature of Mac to send files quickly and easily without dealing with any third party file sharing app. If your Mac doesn’t support the AirDrop, then you can enter the following command to use:
“$ defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool TRUE.”
After this, you will need to restart the Finder first, and you can do that quickly by using killall command in the Terminal that will restart it instantly.
$ killall Finder
And in case you want to revert the changes, enter:
“$ defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool FALSE.”
In this discussion, we discussed about the best Mac terminal commands that an individual can use with its Mac for easy and quick access to do anything with the system. Keep in mind that these commands are sensitive, and you need to be very careful so that you don’t mess up your system. We hope you get what you are looking for; we discussed in detail of these commands. All of the data mentioned here is relevant and authentic; we hope this info is useful to you, and if there are any questions, you can leave a comment below.
What are the commands?
A command is an instruction that is given to the computer app to perform any operation or some kind of task that gives some output. Each device or the OS has their own command interfaces such as windows has its own Command Line Interface where you can enter commands to make the computer do things, and the Mac has a terminal in which commands tell it what to do.