macos terminal commands

The terminal window is an amazing feature offered by Mac. A user can use various types of commands on their Mac OS by using such terminal windows. Although there is a perception among users that macOS terminal windows are only meant for professional users. This isn’t true. If you are a newbie, you can also use the terminal window easily. Such terminal windows will make your task easier and faster. 

Apart from this, it will help you to manage your device properly. It allows you to execute various types of specific operations which are very hard to operate manually. In this article, we are going to give you some best Mac terminal commands that you must use on your system. 

Top 9 macOS Terminal commands

Here is the list of 9 macOS Terminal commands that Every Mac User Must Know in their life. 

1. To keep your Mac awake:- 

If you have a lot of work on your Mac and you need to keep your Mac active then you should use this terminal command. Although there is third-party software available to keep your device awake, these are time and space-consuming. On the other hand, you can keep your Mac awake by simply typing:- caffeinate in the terminal window. 

This command will prevent your Mac from sleeping. Press the Ctrl+C button to remove this command. 

2. Download files from the internet without a browser: 

Have you ever imagined that you can download various files without any internet connection? Yes, this is possible via the terminal window. But to use this function you must have a download link so that you can process it into the command line. Select the folder in which you want to download files and then type cd~/Downloads/. 

To download the file you have to enter curl-0[URL of file] 

3. Check for Mac update:- 

Commonly, you must use a newer version of an application on your Mac.  You can improve the performance of your Mac significantly by just keeping it updated. To check for new updates on your Mac-type 

defaults write ScheduleFrequency -int 1

4. Create a new directory:- 

It’s so simple and easy to create a new directory by using the terminal windows of MacOs. To form a new directory you need to type mkdir command. After that insert the name of the directory as per your wish. The terminal window also allows you to form various directories by different names. You need to enter the directory name and then space.

5. Change the location for the screenshot:- 

You have to do a lot of things to know about the exact location of the screenshot. It can be boring as well as time-consuming. If the same thing is happening with you then we will suggest you use terminal windows of your Mac and get rid of this issue. To change the location for the screenshot you have to enter the following command:- 

defaults write com. apple.screen capture location~/your/location/here. 

6. Create some distance between applications in the dock:- 

If you maintain some distance between various apps in the dock then your Mac’s screen will appear so beautiful as it’s perfectly arranged. To perform this utility type 

defaults write com. apple.dock persistent-apps-array-add{title-type”=”spacer-tile”;}’ 

then enter killall Dock

7. See and Delete your history:- 

You will be shocked to know that Mac records your history of every file that you have downloaded. Do you want to view the whole history of files that you have downloaded on your Mac? If your answer is yes then type the following commands:- 

sqlite3 ~/Library/Preferences/* ‘select LSQuarantineDataURLString from LSQuarantineEvent’

Apart from this, the terminal window of MacOs allows you to delete your whole history at once. To delete the entire history of downloaded files enter this command:- 

sqlite3 ~/Library/Preferences/* ‘delete from LSQuarantineEvent’

 So, it’s a great opportunity for you to view as well as delete the history of downloaded files from mac. 

8. View hidden files:- 

There is a built-in tool in the Mac that hides some impersonal content so that any other person can access them. But you can use terminal windows to get access to such files. To view hidden files in the finder of MacOs, you have to give the following command:- 

defaults write com. apple. finder AppleShowALLFiles TRUE. 

9. Create some space:- 

When you uninstall any unnecessary program from your device then it leaves some residue which hampers the performance of the Mac. Such types of files will consume storage space on the Mac. If you want to delete all such data from your device then you should enter the following command:- 

diskutil secureErase freespace 3/Volumes/names-of-drive. 

You can add any drive in the place of the drive’s name to erase the data from that particular drive. 


That’s all about 9 macOS Terminal commands from big sur macos to ventura macos User Must know. We hope that you have understood all commands that we have described in our article. Although there is a very long list of commands for the macOS terminal window, we have tried to include only those commands which are extremely useful for you. However, you can give your feedback about your experience with these 9 MacOs terminal commands. 

Don’t forget to mention which terminal commands suit you very well and suggest any other commands so that we can refine our content as per your requirement. Thanks and have a great day!

By Anurag Rathod

Anurag Rathod is an Editor of, who is passionate for app-based startup solutions and on-demand business ideas. He believes in spreading tech trends. He is an avid reader and loves thinking out of the box to promote new technologies.