Top 11 Terminal Command Tricks for Mac That You Should Know

Top 11 Terminal Command Tricks for Mac That You Should Know

Apple's macOS platform includes Terminal, the equivalent of the Windows command prompt. Because macOS is based on UNIX, it can give you the impression of a dangerous tool in which an incorrect command can destroy your system. Of course, this is only valid to a certain extent. Many commands can be used to customize the interface and other macOS settings.

Mac Macos Top Terminal Commands Lead "width =" 1392 "height =" 928 "data-size =" auto "size =" (min-width: 976px) 700px, (min-width: 448px) 75vw, 90vw "srcset = " 1392w, media / assets / 2019/08/235423 / Top-Terminal-Commands-mac-macos-lead_935adec67b324b146ff212ec4c69054f.jpg? 1566233840 700w, Top-Terminal -Commands-mac-macos-lead_40dd5eab97016030a3870d712f .jpg? 1566233840 340w

The terminal on macOS can be extremely useful for improving the performance of your Mac. Now, everything depends on what you want to achieve. In case you are worried about using it, you can always put yourself at ease using harmless tips. Here are the top terminal control tips to try on your Mac.

1. Open the folders

One of the best ways to familiarize yourself with the device is to use it to open files and folders. I know that clicking Finder will do the same. However, using Terminal, you can open a specific folder or file without exposing your file structure to anyone.

Say you want to open your documents folder. Then you can type the following command, then press Enter.

 Open ~/Documents

And that opens my Documents folder. There is a DOCX file in this folder. I can also use Terminal to open it. For this, you must type the command with certain requirements:

Open -a "Name of the application" / Path / To / File

Top Open Terminal Commands Mac Macos "width =" 1166 "height =" 590 "data-size =" auto "sizes =" (min-width: 976px) 700px, (min-width: 448px) 75vw, 90vw "srcset = " 1166w, im /media/assets/2019/08/235425/Open-top-terminal-commands-mac-macos_935adec67b324b146ff212ec4c69054f.png?1566235644 700w, / The commands Open-top-terminal-mac-macos_40dd5eab97016030a3870d712fd9ef0f.png? .png? 1566235644 340w

So, to open the DOCX file in the Documents folder of my Mac, I have to type this command, then press Enter:

 Open -a "Microsoft Word" ~/Documents/SoP_Prajith_New.docx

This opens the specific file using the predefined program. You can also use the wildcard (* .extension) instead of the full file name. However, if you have multiple files with the same extension, your Mac may freeze a bit.

2. Change the default backup screen capture location

By default, macOS Mojave stores screenshots on the Mac's desktop. Now, if you have synced iCloud sync, which I'm sure to do, the download will continue on your account. So you can change the location of saving screen captures instead of overloading your desktop.

Here is the command you need to type before pressing Enter:

 defaults write location ~/Downloads

In the above command, you can provide any specific file location instead of ~ / Downloads as shown.

Screen Capture Mac Terminal Location Mac Mac S "width =" 761 "height =" 396 "data-size =" auto "size =" (min-width: 976px) 700px, (min-width: 448px ) 75vw, 90vw "srcset =" 761w, https: / /cdn.guidingechp. imager / media / assets / 2019/08/235427 / catches-rental-terminal-mac-macoS_935adec67b324b146ff212ec4c69054f.png? 1566235644 700w, 500w, https: //cdn.guidingtech. com / imager / media / assets / 2019/08/35427 / Scemor- macoS_7c4a12eb7455b3a1ce1ef1cadcf29289.png? 1566235644 340w

After pressing Enter, I must reset SystemUIServer for the changes to take effect immediately. Then, enter the following command.

 killall SystemUIServer

Although this is not mandatory, I recommend that you restart your Mac.

3. Change the type of capture image

The macOS saves the screenshots in the default JPG format. You can also change this to save as PNG or PDF. Here's how to do this quickly with this specific command:

 defaults write type PNG

After that, you must kill SystemUIServer again.
Most commands that require system changes must force SystemUIServer to stop. So be quick.

 killall SystemUIServer

Now your new screenshots will be saved in PNG format. Note that PNG files are generally larger than JPG files. So keep an eye on the amount of storage space they consume.

4. Show hidden files

Have you tried searching for the option allowing the Finder to display hidden files? Well, it's harder than choosing the hidden files from the show on Windows. I always forget how to activate this. Fortunately, there is a useful command that makes it possible in seconds.

 defaults write AppleShowAllFiles -bool TRUE
Show hidden files Macos Terminal Commands "width =" 996 "height =" 526 "data-size =" auto "= = (min-width: 976px) 700px, (min-width: 448px) 75vw, 90vw" srcset = " 996w, media / assets / 2019/08/235428 / Show-Hidden-Files-Terminal-Commands-macos_935adec67b324b146ff212ec4c69054f.png? 1566235644 700w, Show all hidden files from the terminal .png? 1566235645 340w

After that, you must force the Finder to close.

 killall Finder

You should now see a lot of hidden files in the Finder. They would be gray but still visible. If you cancel this change, you must set TRUE to FALSE in the command.

5. Turn off the dashboard

Apple promoted the Dashboard view for quick access to calculator and sticky notes. I bet you rarely use this one because you can run the Calculator application or Sticky Notes application with the help of Mission Control of Spotlight. So you can turn it off and not have to worry about opening it by mistake.

Here is the command to turn off the dashboard.

 defaults write mcx-disabled -boolean TRUE

Then, you must remove the Dock for the changes to be correctly applied.

 killall Dock

Now I do not have to worry about accidentally opening the dashboard. If you want to enable it again, set TRUE to FALSE in the command.

6. Download files

Did you know that you can download files using the terminal? Yes, you do not need to leave the browser running only for this file. The only requirement here is that you must have the file download link. The syntax of the command is as follows:

curl -0 download link

First, navigate to the folder where you want to download the file. To do this, you must go to the Downloads directory.

Downloads Terminal Commands Mac Mac S "width =" 883 "height =" 460 "data-size =" auto "size =" (min-width: 976px) 700px, (min-width: 448px) 75vw, 90vw "srcset = " 883w, 2019/08/235429 / Downloads-Terminal-Commands-mac-macoS_935adec67b324b146ff212ec4c69054f.png? 1566235645 700w, Commands-mac-s- 40dd5ea
 cd ~/Downloads

After that, you can feed the command to download the VLC for macOS from the official website. It seems like something like this:

 curl -O

Note: There is a letter O in the command and not the 0 (zero).

7. Same for backups

Copying files and backing up to macOS is fast enough – thanks to SSDs and flash storage. However, copying a large amount of data takes a long time. Fortunately, Terminal offers a useful command to copy files. Here's how to do it by looking at the name of the files copied by the command.

idem -V / currentpath / / new / path /

I want to copy the downloaded DMG file in the previous section on the desktop.

 ditto -V ~/Downloads/vlc- ~/Desktop
Same as Mac Macos terminal commands "width =" 883 "height =" 460 "data-size =" auto "= = (min-width: 976px) 700px, (min-width: 448px) 75vw, 90vw" srcset = "https : // 1566235645 883w, assets / 2019 / 08/235430 / Ditto-Terminal-Commands-mac-macos_935adec67b324b146ff212ec4c69054f.png? 1566235645 700w, -mac-macos_40dd5eab97016030a3870d712fd9ef0f. png? 1566235645 500w,

This should do the right thing. If you want to copy the files to an external drive, you must provide the destination path correctly.

8. Always show the file path in the Finder

If you changed Windows, you would have noticed that the Finder on macOS does not show the file path as the Windows Explorer. However, you can force Finder to show you the file path with this command:

 defaults write _FXShowPosixPathInTitle -boolean true
Terminal Commands Show Path Mac Macros "width =" 1019 "height =" 540 "data-sizes =" auto "sizes =" (minimum width: 976px) 700px, (minimum width: 448px) 75vw, 90vw "srcset =" https : // 1566235646 1019w, /media/assets/2019/08/235431/Show-Path-Terminal-Commands-mac-macos_935adec67b324b146ff212ec4c69054f.png?1566235646 700w, Show the document path-show-path .png? 1566235646 340w

After pressing Enter, you must stop the Finder.

 killall Finder

After pressing Enter, the Finder will be restarted. Then you should see the file paths at the top of the Finder window.

9. Power chime when connecting the charger

Have you ever connected the MagSafe charger to your Mac without forgetting to press the power switch? I lost the account. Fortunately, I came across this useful command that provides an audio chime back when I connect the MagSafe charger.

Load this command into the terminal and press Enter.

 defaults write ChimeOnAllHardware -bool true; open /System/Library/CoreServices/

10. Stop your Mac from sleeping

Often you download a large file and you do not want your Mac to fall asleep. If it is a temporary requirement, a simple command can get there. Just type the following command, press Enter and exit your Mac.

 caffeinate -u -t 600
Standby / Wake-up Terminal Commands Mac Macos "width =" 685 "height =" 460 "data-size =" auto "= = (min-width: 976px) 700px, (min-width: 448px) 75vw, 90vw" srcset = " 685w, / media / assets / 2019/08/235432 / Sleep-wake-terminal-commands-mac-macos_40dd5eab97016030a3870d712fd9ef0f.png? 1566235646 500w, -summer-commands-mac-macos_7c4a12eb7455b3a1ce1ef1cadcf29289.png? 1566235646 340w

In this command, the number 600 means seconds. So with this command, the Mac will not sleep for 10 minutes (600 seconds). You can enter a relevant number of seconds or just the word "caffeine"to prevent your Mac from sleeping.

However, if you close the window of this terminal, the command stops the run and the Mac goes to sleep at a predefined time.

11. Check the availability of your Mac

Ever wondered how long you have restarted your Mac? A simple reboot can sort a lot of things and improve the performance of your Mac. Here's a command to check how long your Mac has been running without restarting or shutting down

Mac Macos Uptime Terminal Commands "width =" 685 "height =" 460 "data-size =" auto "= (min-width: 976px) 700px, (min-width: 448px) 75vw, 90vw" srcset = "https : // 1566235646 685w, assets / 2019/08 / 235433 / Uptime-Terminal-Commands-mac-macos_40dd5eab97016030a3870d712fd9ef0f.png? 1566235646 500w, -mac-macos_7c4a12eb7455b3a1ce1ef1cadcf29289.png? 1566235646 340w

This should give you all the details with a timestamp.

Using a terminal, it's fun

The terminal is a pure pleasure to use and tinker in the macOS. However, we strictly advise against using random commands provided by unverified sources or unknowns. Apart from that, these commands must be run on the latest macOS Mojave update until the latest version.

You should always check the device's commands to delete, delete, or disable any service. If you stick to our list, you'd be confident to use Terminal like a pro.

Then: Are you tired of the same old lock screen on your Mac? Here's a handy guide that will show you how to customize the lock screen of your MacOS Mojave on Mac.

Leave a Reply