macOS

macOS Terminal: A Complete Beginner's Guide

This guide will teach you to confidently use Terminal on Mac. You'll learn how to open windows, navigate the file system, perform basic file and folder operations, and safely exit.

Updated at February 15, 2026
15-20 minutes
Easy
FixPedia Team
Применимо к:macOS Sonoma (14.x)macOS Ventura (13.x)macOS Monterey (12.x)macOS Big Sur (11.x)

Introduction / Why This Is Useful

The Terminal in macOS is a powerful tool for system management, software installation, task automation, and troubleshooting issues not accessible through the graphical interface. Even basic command-line skills will significantly boost your efficiency as a Mac user. After this guide, you'll be able to confidently navigate the filesystem, view and create files, and execute basic system commands.

Requirements / Preparation

Before starting, ensure you have:

  • macOS version 10.15 (Catalina) or newer installed (instructions are relevant for Sonoma, Ventura, Monterey).
  • Access to an account with standard privileges (administrator rights are not required for most basic operations in your home folder).
  • The Terminal utility — it comes preinstalled on all macOS versions and is located in /Applications/Utilities/Terminal.app.

Step 1: Open Terminal and Understand the Interface

  1. Open Terminal using one of these methods:
    • Press Cmd + Space to launch Spotlight, type terminal, and press Enter.
    • Open Finder, go to the ApplicationsUtilities folder, and double-click Terminal.
    • Use Launchpad (the icon in the Dock) and find the app among the others.
  2. After launching, you'll see a window with a black (or light, depending on your profile) background and a line that looks like this:
    user@MacBook-Pro ~ %
    
    • user — your username in the system.
    • MacBook-Pro — your computer name (can be changed in System Settings → General → About This Mac).
    • ~ (tilde) — represents your home directory (/Users/your_username). This is your current location.
    • % — this is the command prompt. In bash-based systems (standard for macOS before Catalina), it's % for regular users and # for root. In newer versions (using zsh by default), it's % or $.
  3. The cursor blinks after %. Everything you type will be interpreted as a command. Use only Latin letters and symbols when typing commands; the Russian keyboard layout can cause errors.

Step 2: Basic Filesystem Navigation Commands

Understand your current location before running commands.

  1. Show the current path (pwd). Type the command and press Enter:
    pwd
    

    Terminal will output the full path to the current directory, for example:
    /Users/john
    
  2. View contents of the current folder (ls).
    ls
    

    By default, it shows only file and folder names. For a more detailed output (permissions, owner, size, date), use the -l flag:
    ls -l
    
  3. Change to another folder (cd — change directory).
    • Change to the Documents folder (create it in Finder beforehand if it doesn't exist):
      cd Documents
      
    • Go back to the previous directory (one level up):
      cd ..
      
    • Return directly to your home directory (from anywhere):
      cd ~
      
      or simply
      cd
      
  4. Autocomplete (Tab). When typing a folder or file name, press the Tab key. Terminal will automatically complete the name if it's unambiguous. If there are multiple matches, press Tab twice to see them. This saves time and prevents typos.

Step 3: Practice: Creating and Working with Files

Let's practice by creating a temporary structure.

  1. Create a new folder (mkdir — make directory). Ensure you're in your home directory (cd ~). Create a folder named terminal_test:
    mkdir terminal_test
    
  2. Navigate into the created folder and create a file (touch).
    cd terminal_test
    touch notes.txt
    

    The notes.txt file will be created empty.
  3. Write text to a file (output redirection). The simplest way is to use the echo command and the > symbol (redirect output to a file):
    echo "Hello, Terminal!" > notes.txt
    

    Note: > overwrites the file if it already exists. To append text to the end of a file, use >>.
  4. View file contents (cat).
    cat notes.txt
    

    The string Hello, Terminal! will appear on the screen.
  5. Delete a file and a folder (rm and rmdir).
    • Delete the file:
      rm notes.txt
      
    • Go up one level and delete the empty folder:
      cd ..
      rmdir terminal_test
      
    • Caution! The rm command without flags deletes files permanently (they don't go to the Trash). To delete non-empty folders, use rm -r <folder_name>. Be extremely careful with rm, especially with sudo rm -rf /.

Step 4: Useful Utilities for Daily Use

  • clear — clear the terminal screen (same as Cmd + K).
  • history — show a list of commands you've entered.
  • man <command> — open detailed documentation (manual) for any command. Press q to exit the manual.
    man ls
    
  • Ctrl + R — search through command history. Start typing part of a command, and Terminal will find the most recent match.

Step 5: Ending Your Terminal Session

  • To close the terminal window, simply close it (the X in the corner) or type exit and press Enter. All processes running in that window will terminate.
  • If you connected to a remote server via SSH, use exit or Ctrl + D to disconnect.
  • Do not use commands like sudo shutdown -h now or other system commands to shut down your Mac from the terminal unless absolutely necessary. Use graphical methods for that.

Checklist

You've successfully learned the basics if you can:

  1. Open Terminal and understand where you are (using pwd).
  2. Navigate to another folder (cd) and go back.
  3. View a list of files (ls).
  4. Create a folder (mkdir), create a file inside it (touch), write text to it (echo >).
  5. Read file contents (cat) and delete it (rm).
  6. Safely end your session (exit or closing the window).

Common Issues

  • command not found: The command was typed incorrectly or doesn't exist. Check spelling. Ensure you're not trying to run a Linux-only command (e.g., apt).
  • Permission denied: You lack sufficient permissions for the operation (e.g., writing to a system folder). Don't try to bypass this with sudo unless you understand the consequences. Work within your home directory (/Users/your_username).
  • No such file or directory: The specified file or folder wasn't found at the given path. Check your current directory (pwd) and the name's accuracy (case matters: Folder and folder are different names in Unix systems).
  • Terminal "freezes": You launched an interactive program (e.g., top, vim, ssh). To exit, use Ctrl + C (interrupt) or Ctrl + D (end input/exit). If that doesn't work, close the terminal window.
  • Cyrillic in paths or filenames: The macOS command line (zsh/bash) primarily uses UTF-8, but some older utilities may not handle Cyrillic correctly. Try to use Latin names for folders and files you plan to work with from the terminal.

F.A.Q.

Can you damage the system by using the terminal?
How to change text or background color in the terminal?
What is `~` (tilde) in paths?
How to copy text from the terminal?

Hints

Open Terminal
Understand the interface structure
Learn basic navigation
Perform a few practical commands
Safely exit
FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community