Posted in

What is Terminal on Mac? The Ultimate Beginner’s Guide

Terminal on Mac
Terminal on Mac

Do you remember the first time you used the Terminal utility on your Mac? What did you use it for? I remember I first used this tool just a few months ago. At that time, I needed to install an internal data extract tool provided by my developer colleague on my Mac, but I didn’t know how. The colleague reminded me that I should use the Mac’s built-in Terminal. If you’re like me—a non-developer who hadn’t used it before—this article will guide you through understanding what Terminal is, how to use it, and essential commands to boost your workflow efficiency.

Table of Contents

Part 1. What Is The Terminal on Mac?

Terminal is one of Mac’s built-in utilities that allows you to interact directly with the computer operating system using a command-line interface (CLI). It uses a shell, typically zsh or bash, to interpret and execute commands. With the right commands, the Terminal provides powerful control over the system, manages files, and software installations—often beyond what’s possible through the graphical interface.

Part 2. How to Open Terminal on Mac?

There are various ways to open the Terminal on your Mac. The shortcut to open Terminal is by pressing Command + Space, then typing “Terminal” and pressing Enter. Alternatively, you can use Launchpad by pressing F4 and searching for “Terminal“. You can also find it by clicking Finder > Applications > Utilities > Terminal. Once you open the Terminal on Mac, you will see a small window with a white background.

Search for Terminal
Search for Terminal

In the Terminal window, you can see your username in the title bar, the word “bash” or “zsh,” and the window’s dimensions in pixels. “bash” or “zsh” is a type of command-line shell used by Terminal. Bash (Bourne Again Shell) is the default shell on Macs before macOS Catalina, and zsh (Z Shell) runs on top of bash with more features like auto-suggestions, spelling corrections, and better customization.

Open Terminal on Mac
Open Terminal on Mac

 

Quick Tip: What is A Shell?

A shell is like a translator between you and your computer’s operating system. Instead of clicking around, you type command codes, and then the shell runs them.

Part 3. What Can You Do with Terminal on Mac?

Compared to traditional graphical interfaces, Terminal provides quick access to all available commands, making it easier and faster to perform tasks. As a general Mac user, you can use it to batch move or rename files, view hidden files in one folder, install a program or software that is not available in the App Store, and so on. For example, to check all files in the Documents folder:

Type “cd ~/Documents” in the Terminal and press Enter, to navigate to your Home folder.

Type “ls” and press Enter, and you will see all files in the Documents folder.

Check Files in Documents Folder
Check Files in Documents Folder

Tips to Use Terminal:

  • All commands execute only after pressing the Return key. You can use the Up arrow key to repeat a command.
  • If you enter the wrong code carelessly, you can use the Left or Right arrow keys and type Delete it before pressing Enter. Or press Command + K to clear the screen after you press Return, and then retype the right commands.
  • Generally, you need to go to the Finder to see the changes you made with Terminal, except the command requires a new window display.

Part 4. Basic Terminal Commands You Should Know

Generally, a bash or zsh command consists of three parts: the command name + a modifier to the command’s output + the path to a folder or directory.

4.1 Command “cd”: Change Directory

“cd ~/folder name” is one of the most common commands when working with the CL. This command is used to change the directory you are working in the Terminal to execute other commands on a different directory, view the contents of a different directory or open a file in a different directory.

4.2 Command “ls”: List All Files

After using the “cd” command, you can utilize the “ls” command to check all files or folders in the desired directory. Applying the argument “ls -l” to get more details of each file, including permissions, owner, and date created.

4.3  Command “open + space + filename”: Open A File

If you wish to open a file in the files listing, just use the command “open + space + filename” and you will see the file is been launched automatically. It’s very convenient for you to quickly open the target files in a large number of files.

4.4 Command “mkdir + space + foldername”: Create A Directory

The Terminal app also allows you to create a new directory (folder) as expected.  Entering “mkdir + space + foldername” in the current working directory, you will see the new folder is generated in the desired location. No screen switch back and forth, all you need is a small but powerful Terminal.

4.5 Command “rmdir + space + foldername”: Remove A Directory

When you want to delete an unused directory (folder), simply type the command “rmdir + space + foldername” to remove it immediately. By doing so, the directory (folder) is deleted permanently. You don’t need to clear the Trash again.

Leave a Reply

Your email address will not be published. Required fields are marked *