Home Mac Must Know Mac Terminal Commands And Their Functions

Must Know Mac Terminal Commands And Their Functions

0

Users who aren’t familiar with Mac terminal commands usually give up after a few tries. This is because using Mac terminal commands sometimes can seem like it was made only for “experts”.

So most times people just give up before even trying to learn because they assume it is really hard.

Is Using Terminal Commands Hard?

I won’t say that it’s exactly hard even though there are so many terminal commands to use. The only difficulty is from remembering all the terminal commands.

There are ways around that now. I will explain in this article some of the most useful Mac terminal commands and how to run the commands.

I will also be suggesting an app that should help new users get acquainted pretty easily with Mac terminal commands.

How Is The Terminal Window Useful?

Must Know Mac Terminal Commands And Their Functions

 

What terminal commands offer is unique access to a lot of features that are not normally used by the everyday Mac OS user.

These commands really give you a full rein to use your system in its entirety. There are some cool command lines that might interest you too if you’re considering using Mac terminal commands.

Some Of The More Popular Terminal Commands

Before I start on the actual terminal commands, I want to first explain how to open a command prompt.

There’s no use learning about terminal commands if you can’t open a command prompt so it is important you understand this process or at least be able to follow it to open a command prompt.

How To Open A Terminal Window (Command Prompt)

The first step is to double click on the Mac HD icon and navigate to a folder named Applications.

The second step is to open the Utility folder and select Terminal.

Mac Terminal Commands

That’s pretty much what you need to do whenever you want to open a terminal.

Once you select Terminal, a window will pop up and you will see your Mac’s description, your own username, and then a dollar ($) sign.

The text space after all of the above is where the terminal commands you want to work it will go.

Using terminal commands can be a little bit intimidating at first but if you continue to use it regularly, it will become second nature to you in no time at all.

Now let’s move on to the actual Mac terminal commands you can use to make work easier, the commands you can use to access features of your system you can’t normally get to, and the commands that are just cool and fun to use.

Revealing Or Hiding Folders/Files

This terminal command is really quite helpful in finding folders that are normally hidden and it also helps in maintaining the privacy of your personal folders especially if you’re not the only person using the system.

Here’s the terminal command text for revealing hidden files –

defaults write com.apple.finder AppleShowAllFiles YES

Here’s the terminal command text for hiding public files –

defaults write com.apple.finder AppleShowAllFiles NO 

I hope you remember where the command lines go (just after your Mac’s name and your own profile’s username).

Also, remember to press the Return key to run the commands.

Using Terminal Commands To Download Files Directly To Your System Without Using A Browser

This next terminal command is really cool and it’s a popular choice amongst users who might have used it to download music mp3 from sites such as Limewire.

There is a small catch though, you have to know the location of the file you’re trying to download.

Once you’ve gotten that information, just follow the steps below to use terminal commands to download the file.

Open a terminal window (as explained above) and enter this command.

cd ~/Downloads/ curl  “file to be downloaded” -o “new file name”

The first command line is also used for changing directories in Terminal so you should take note of that.

As long as you got your file location right, your download should be on without you using a browser.

Making Sure Your Mac System Stays On

There are normal settings available that might help with this and there are even 3rd party apps that can help you manage your system’s Sleep settings.

But using a terminal command is faster if you’re used to running terminal commands. Here’s how to do that.

Open the terminal window and enter this command line

caffeinate -u -t {input here the number of seconds you want the Mac OS screen to stay on for.

Accessing Corrupted (Or Any) Folders  & Files

Sometimes important files can get corrupted and it’ll be a huge loss if they are irrecoverable. I’ll advise you not to bother using this terminal command for files like images or audio because it does not work in many cases.

It is however extremely useful for corrupted Word documents. You can use it to at least salvage information from the corrupted documents. That’s why this terminal command is popular among users.

Here’s the command prompt text –

cat ~ /file/path/here 

Use this window to gain access to corrupted docs whenever you want and salvage the little bit of information you can.

Clearing Inactive Apps That Clutter Your Dock

This Mac terminal command is really important because most users have a lot of apps that are not active.

These apps can clutter up your Dock, so what the command will do is remove all of the non-active apps and only display the active apps.

Here’s the terminal command –

defaults write com.apple.dock static-only -boolean TRUE; killall Dock 

Mac Terminal Commands

Run this Terminal command and you should be able to hide all the apps that you don’t frequently use.

Tinkering With Apps That Don’t Show Up On Monitors

You can dim these apps by using this terminal command –

defaults write com.apple.Dock showhidden -boolean TRUE; killall Dock Easily 

Moving Files Within Folders Without Dragging And Dropping

This terminal command is another great example of what Mac terminal commands can do. Instead of following that really long copying files process, you can just easily use a command to move the files.

You have to open a Terminal and then use the terminal command called (Ditto) to transfer the files.

Here’s the command text –

Ditto [original folder] [new folder]

You can even use this command if you have folders in different locations that are named the same.

All you have to do is add (-v) just after Ditto without the parenthesis of course. Something like this –

Ditto -v [original folder] [new folder]

Tweaking Default Screenshot Settings And Making The Screenshot Process Better

If you’re the type of user that screenshots a lot of the time, you must be getting tired of how cluttered your system must be.

Just use this terminal command below to easily set up a directory where the screenshots will be saved and the cluttering will stop.

Here’s the terminal command –

defaults write com.apple.screencapture location /new “folder for screen capture”

Hit enter and type the next command below:

killall SystemUIServer 

Tweaking Screenshots Settings

I will be explaining two different tweaks you can make. The first one is changing the default screenshots format from maybe PNG to JPEGs.

You can even change it to PDFs or some other format you’re comfortable with.

Here’s the command prompt text –

defaults write com.apple.screencapture type jpg

The second one is enhancing the quality of screenshots.

Normally, whenever you take screenshots, the drop shadow effect can be really frustrating so just turn off the effect and this is the command prompt text you need it you want to do that –

$ defaults write com.apple.screencapture disable-shadow -boolean TRUE; killall SystemUIServer 

These terminal commands are a lot to take in at first but I promise you’ll be able to figure it out soon enough, as long as you study this article and save for future references.

Playing Games

You can also use Mac terminal commands to access some popular games and play. Here’s how to go about this.

You have to first open a terminal window.

Enter this text –

emacs

A new window will pop out, choose

GNU Emacs 

and then hit on Escape.

When the next screen appears, input the alphabet “x” (without the parenthesis) and then input the name of the game you want to play (Tetris, Snake, And Other Classic Games) and then select Enter.

Using Alternatives

Some of us will never be able to get used to Mac terminal commands but there is still a way out for you.

Let’s talk about MacPilot. The tool MacPilot is known for helping users gain access to more than a thousand features without the whole terminal commands process.

The good news is that you don’t have to memorize terminal commands. The commands are already grouped by the processes they perform.

All you have to do is launch the app and look for the process you want to perform. You will be able to run the same terminal commands functions easily without needing to enter terminal commands.

Please note however that although MacPilot offers a free version for a short period of time, you will have to purchase the tool to use it in the long-term.

You may like to explore our video on the Absolute BEGINNER Guide to the Mac OS Terminal.

Conclusion

It is important to learn how to use Mac terminal commands because we would be wasting away a lot of features on our system if we don’t use terminal commands.

There are so many options for us to choose from and even though that might seem like a hassle, it isn’t because there are ways to always get the commands you need when you need it.

You could maybe get online references in articles like this or maybe you’re using the “not free’ MacPilot tool.

Have you ever used Mac terminal commands? If you have, which ones are your favorites? Please use the comment section to tell us all about your experience running terminal commands.