How to Use Terminal on Mac

thumbnail

The Mac Terminal is a command line system that can help you quickly take control of your operating system and make changes. Getting to this app is easy – you can navigate via your Mac’s Finder or through Spotlight. In this article, we will discover how to open and use Mac Terminal.

What is Terminal on Mac?

Whether you’re a long-time Mac user or just recently made the transition from a computer running Windows or Linux, one thing you will probably associate with Mac is it’s amazingly sleek and friendly graphical user interface (GUI). Through the macOS GUI, you will probably be able to handle most of the daily tasks an average user might need to get done on their device. For the advanced and professional users however, that just isn’t enough.

That’s where Terminal comes in. What is Terminal on Mac, you ask? Well, you should first know that while it’s probably one of the least well-known tools in the Mac’s arsenal, it’s also probably the most versatile and useful once you learn how to use it. In the simplest of terms, it’s a command-line utility, allowing the user to input lines of code in order to make stuff happen on their device.

Think of the Windows Command Prompt if you’re not a regular Mac user and you should have a good idea what Terminal does. It can help complete very useful tasks such as downloading files without using your browser, adding a message to your login window, or setting your Mac to automatically restart if it crashes.

Terminal on Mac.

How to open Terminal on Mac

If you are wondering how to get to Terminal on Mac, there are three main ways to do this: by going to the Applications folder in Finder, by using the Spotlight search bar, and by using Launchpad. Here are brief step-by-step guides for these processes.

How to open Terminal via the Finder

1. Go to Finder.

2. On the left toolbar, select “Applications” and then scroll down until you find “Utilities”.

Select Applications and then find Utilities.

3. In the Utilities folder, you’ll find the Terminal app. Double-click to open it.

How to open Terminal via the Finder.

How to open Terminal through Spotlight

1. Hold down the “Command” button and the space bar at the same time. Search bar will open.

2. Type “Terminal” in the field.

How to open Terminal through Spotlight.

3. Find it from the list and double click on it.

How to open Terminal through Launchpad

1. Open Launchpad from the Dock or press Fn and F4 simultaneously.

2. When Launchpad opens, type “Terminal” in the search bar.

How to open Terminal through Launchpad.

3. Click the Terminal icon.

You can also use Siri to launch Terminal: simply click the Siri icon and say “Open Terminal”. To quit the app, you just need to click Terminal > Quit Terminal or use the Command + Q shortcut.

Open Terminal from Applications folder

1. Open a new Finder window.

2. Go to Applications in the side menu bar.

3. Double-click Utilities folder and scroll down to Terminal.

Open Terminal from Applications folder
Users situation:
Just got a Mac this year and I'm very interested in learning how to use Terminal and commands through them. I have no programming experience.
— Reddit

Best Terminal alternatives for Mac

While Terminal is a great and versatile utility to have and use, it’s not necessarily the only option you have, nor the easiest to use. We’d also recommend looking for an alternative solution which can emulate Terminal functions in a more user-friendly manner, which is what having a Mac is all about, after all. Again, if you’re more familiar with Windows, think of this as a cmder for Mac. Here are a few options which we’ve tested out and considered to be the best of the bunch.

Commander One

If you want to skip a lot of the hassle that comes with learning how to use Terminal on Mac, we recommend looking into Commander One. It’s a macOS file manager that has a dual-pane interface and supports opening multiple tabs. Through this interface, moving and copying files from one place to another becomes a breeze, and the tabs will help you avoid and eliminate clutter.

It supports various file types which you can also search for by name or even content. Speaking of files, for the more advanced users which want to peek behind the macOS’s curtain, through Commander One you can see all the hidden files on your Mac.

A tangible way through which Commander One can help improve your work efficiency is the option of setting your own hotkeys for actions you take most often, thus reducing a flow that might otherwise take a few minutes to the instant it takes to hit a button. Combined with the smart organization of file operations in queues and many more advanced options, this utility tool is sure to change the way you interact with your Mac.

Commander One is a file management tool.

Besides being one of the best file managers, Commander One also works as the Terminal emulator, making it extremely easy to manage all the system processes. You can invoke the app simply by using hotkeys. The emulator includes all the necessary features, and eliminates the need for switching between apps while working with it. All Mac Terminal commands can be executed in the application window.

Pros

  • Can be easily customized according to your needs
  • Integrated with cloud storages
  • FTP / SFTP / FTPS are supported
  • Work with iOS / Android and MTP devices.

Cons

  • No multiple rename feature
  • Doesn’t support comparison / directory synchronization.

Supported OS: macOS
Price:
 Free/Pro version $29.99

iTerm2

Another emulator of Terminal on Mac is iTerm2. It offers a set of handy features and is a great choice for both beginners or advanced users. iTerm2 enables you to split a tab into multiple panes, automate routine commands, and comes with a robust in-page search function which makes browsing much easier. Besides that, you can speed up your work with hotkeys and copy without using a mouse.

iTerm2 is one more emulator of Terminal.

Pros

  • Offers autocomplete feature and instant replay
  • Growl integration
  • Has a built-in password manager.

Cons

  • macOS 10.14 or higher is required
  • Doesn’t support register-transfer level.

Supported OS: macOS

Price: free

Basic Terminal commands you should know

So now that you’ve figured out how to open up Terminal on Mac, and you’ve even looked into a a nifty alternative as well, let’s get you through a short and sweet Mac Terminal tutorial which should have you set on the road to customizing every single aspect of your macOS experience.

How to execute a Terminal command

With your Terminal window opened in front of you, you might experience a flashback from early 2000’s hacker movies but try to refrain from yelling out “I’m in the mainframe!” and let’s get to typing. First thing to keep in mind is that in order to execute any Terminal command, you will need to hit the Return key, as simply typing it out won’t do anything.

Once you’ve typed out your command and hit the Return key, one of two scenarios will play out. Either you’ll get an error if some mistake crept into your command line, or the command will execute. If you requested an action that is supposed to display a text response, such as ls for example, which shows you the files and / or folders in the current directory, a list of said items will appear in the Terminal window.

If the command you executed does not require a text reply, you will simply get a new line mentioning your username once the command is finished processing. This would be the case for a command such as caffeinate which will prevent your Mac going to sleep while the Terminal window is opened or until you press Control + C.

Another important detail you should keep in mind when using Terminal is that most, if not all commands are case-sensitive. So be sure to write “Dock” when you are referring to the Dock, otherwise your command will return an error or worse, do something else than expected.

Finally, most of the commands you’ll be executing in Terminal will most likely be to run apps or open files. In order to do this efficiently through emulator, you will need to build a Path for them to run.

How to execute a Terminal command.

What is a Path?

In Terminal speak, “path” can mean two different things depending on capitalization. The lowercase path simply refers to the file or app’s location on your computer, in folders and subfolder. Their address, if you will, by way of following the structure of your folders. For example, the path to the Terminal app is /Applications/Utilities/Terminal.app. The way run an app or open a folder in it is very much dependent on their path from where you are.

As such, a path can take two forms. The first is an absolute path, which is the file’s full address regardless of the folder where you’re currently working from. An absolute path starts at the root level of your hard drive and is displayed as /. The second is a relative path, meaning relative to the position where you have already navigated to, and is represented by ./. For example, fif you’ve already gone to the /Applications/ folder in Terminal and now wish to move to Utilities, instead of typing out the entire (absolute) path, you’ll just need to type out ./Utilities/.

By default, when launching Terminal, you’ll start off in your User folder, specifically /Users/*yourusername*/ (this is a placeholder, you will see the name of the user that’s logged in at that time.

The other meaning of path in Terminal, is a list of pre-designated directories is stored in a special variable called the “PATH”. The PATH is useful since it provides us with a set of directories where Terminal will automatically look for matching file names, making it quicker to access the files you use most often without having to type out their absolute or relative paths each time.

All we need to do is make sure that the programs or files we’re trying to run have a path in one of those directories, or that we add that program’s path to the PATH. In order to see which directories are in your PATH, you can type out echo $PATH and it should return a list of which directories are stored in it.

How to display and move between files in Terminal

Now it’s time to get our feet a bit wet. First thing you should know is that the address in your computer where you are currently at is called a current working directory, or cwd for short.

One of the first things you can do in your cwd is to find out what files and folder there are at this address. In order to do this, just type ls and as we’ve mentioned a bit earlier, you’ll get a list of the directory’s contents. You can get some more information from the ls command by adding a switch at the end of it. A few examples are:

  • l, which lets you view the permissions of each file in the directory
  • R, which will not only show each folder in the directory, but all their files, as well
  • a, which will show any hidden files in the current directory.
    If you’d like to see the file list of a different directory other than your cwd, without actually changing your current working directory, just add that directory’s absolute or relative path after the command, like this ls /Applications/Utilities/.

The second main thing you can do in terminal is to change your cwd, by using the cd command followed by the path you want to reach, like this cd /Applications/Utilities/.

Another useful command to use in Terminal is pwd, which will display the full path of your cwd, in case you need to quickly remember what your current directory is.

Lastly, once you start doing your own research into what other neat tricks you can perform, make sure to remember the man command, followed by whichever interesting command you found. This will return with information on the command you typed out after the man command. For example, man pwd will return information on the pwd command which displays your current working directory path.

Conclusion

If you’re new to using the Terminal app on a Mac, take some time to understand it. Mac Terminal is good enough and does its job efficiently, but it is not the only option available. If you are looking for more features and customizable solutions, there are enhanced apps like Commander One. It is one of the powerful Terminal emulators with a wide set of handy features. Not only this, it even serves as an FTP client and file manager for Mac.

While Mac Terminal and its alternatives listed above will give you full control over your system, you should be careful to get it right.

Frequently Asked Questions

To start working with Terminal, you need to know the basic commands. For example, to set your computer to check for updates daily, you should use: defaults write com.apple.SoftwareUpdate ScheduleFrequency 1. You can find more details in this article.

Terminal is a Mac command line interface with which you can access the Unix part of macOS to manage files and run scripts via text commands. You can find it in the / Applications / Utilities / folder. Once you launch the Terminal, you will be able to enter the commands to your computer. But first, you’ll need to understand its basic commands and functions. Each of these commands is responsible for a specific action. Once you’ve done that, you can start using Terminal to accomplish tasks.

Terminal emulator Mac is a software that emulates the functionality of traditional computer terminals. It gives access to the console and command line interface, provides more control over all functions, and speeds up processes as well. Terminal emulators are usually more customizable and feature-rich compared to the built-in Terminal.