A few decades ago, GUIs were a distant dream for almost every computing device out there. The user has to take some commands by heart when it comes to using a PC or Macintosh device. The same is the case when you want to do a simple calculation, or when it comes to moving files from one folder to another. Then came Apple Lisa, which brought an intuitive windowing and mouse system to the computer.
Everything has been so easy since then, but for some reason almost every OS still keeps the space command prompt and terminal. If you are using Windows, you will be familiar with the command line prompt for performing certain tasks. When we came to MacOS, however, its counterpart was named Terminal. This is not mandatory, you should know how to use the terminal on MacOS.
However, there are a few situations where the Mac's terminal can be very useful. Obviously, you can find some terminal tricks and tips too. In this article, we've Latest Mailing Database created a list of the best terminal tricks and commands to know. Personally, I find these commands occasionally useful; we hope they help you.
Access Terminal on Mac
The easiest way to access the Apple Terminal is to use Spotlight Search. Just press CMD + space and enter the item, "terminal" in the search bar. In the second you can see a similar photo of the terminal interface we have given below.
Now that you've opened and seen Terminal, we'll move on to tips and tricks, right?
#1 Stop your Mac from automatic hibernation - it stays awake
If you're someone who's running some apps, you won't want to go to sleep on the Mac. My idea was to go to energy saving preferences and turn hibernate off. However, using the terminal, it's just a command away. You can use the following Mac Terminal commands to make sure your Mac never goes to sleep again.
Just type the command in the terminal and press Enter. In an instant, your Mac becomes sleepless. This is an awesome feature if you want to keep your Mac running almost every time. This is a useful command if you want to leave your Mac with some serious background tasks.
#2 Know Your Mac's Uptime
On most days, I don't really shut down my Mac. In fact, I don't even remember the last time I shut down my Mac. That said, it is necessary that you should shut down and restart your Mac after a while. To know how long your Mac has been running without being shut down, you can use the following command in Terminal.
Just hit enter to see your Mac's total uptime so far. It needs to be pointed out that the time will not be affected by the number of charge cycles or anything. In my case it's been several days, as you can see.
#3 Manage your screenshots
Did you know that Macs come preinstalled with a built-in utility for capturing screenshots? It allows you to take multiple photos from the full screen, a specific area or a specific window. Due to the default settings, however, screenshots will be saved in the Pictures and Desktop folders in .png format. Chances are, you may need to customize it in the long run.
To change the format in which screenshots are saved, you can use the command below.
Write com.apple.screencapture type JPG by default
Other formats of JPG can be substituted upon request. This is a very useful feature if you want to get screenshots from your Mac that take up less space.
To change where screenshots are automatically saved, there is another command. You can paste your desired location in the corresponding place.
Default write com.apple.screencapture location ~/Users/abhijithnarjunan/Desktop/Capture
After you enter the above command, paste the one below. This will refresh the system UI server and save
On the second day of the second day, the setting will be changed. From now on, captured screenshots will be saved in the provided location in .JPG format.
#4 Hide files/folders from find
On Mac, you don't need to make a hidden folder for third-party apps. Needless to say, this is a cool feature if you have something secret you don't want others to see. There are several terminal commands to hide and unhide certain files and folders.
To hide specific folders from the search interface, use the command below. Of course, you will have folders you need to hide in place of directory names.
chflags hide /Users/abhijithnarjunan/Desktop/Documents
Press enter and the folder disappears from the Finder window or desktop. Make sure you can recall the directory name. If you can't keep a safe place.
To bring the folder back to the Finder, there is another command used. Just paste one of the following.
chflags nohidden /Users/abhijithnarjunan/Desktop/Documents
Instantly, you can see the folder appear.
#5 Custom Dock
Did you know that you can customize the design of your Mac's dock using Terminal? In fact, all you can and all it takes is a bunch of commands. We put some of them here.
Suppose you have various ap