Operations 17 min read

A Beginner’s Guide to macOS Terminal: Basics, Common Commands, and Advanced Tips

This article introduces macOS Terminal as the bridge between the kernel and the user interface, explains how to open it, covers fundamental concepts such as commands, paths, and file operations, and provides a collection of practical commands—from simple echoes to disk management and Homebrew installation—while warning about risky operations and offering advanced customization tips.

Architecture Digest
Architecture Digest
Architecture Digest
A Beginner’s Guide to macOS Terminal: Basics, Common Commands, and Advanced Tips

The article starts with a light‑hearted observation that terminal windows in movies often signal a "computer guru" and explains that, despite the myth, the terminal truly gives users control over the entire system.

What Is the Terminal?

The terminal is described as the bridge connecting the operating system kernel (the core logic) with the user interface, allowing users to issue commands that the system executes directly.

How to Open the Terminal

On macOS you can launch the Terminal app via Spotlight by typing "Terminal" (or "终端") and pressing Enter; a GIF demonstrates the quick opening.

Basic Knowledge

After opening the terminal you are prompted for a command. A command is simply a phrase telling the computer what to do. Example: say hi makes the system speak "hi".

Commands consist of three parts: the command object (e.g., say), optional modifiers (e.g., -r 500 to slow speech), and the command content (e.g., hi).

Common introductory commands include: echo "text" – prints the supplied text. pwd – shows the current working directory. cd /path/to/folder – changes the current directory; cd ./Utilities demonstrates relative paths. ls – lists files; ls -R lists recursively. clear – clears the screen. sudo – runs a command with super‑user privileges after password confirmation.

Useful macOS‑Specific Commands

Various defaults commands modify system Plist settings, such as disabling crash dialogs, changing screenshot format, showing hidden files, and customizing the Dock.

File‑related commands include touch -t 199505090000 file to set timestamps, and rm (with a warning about its destructive potential).

Disk management commands ( diskutil) can list disks, resize volumes, or erase partitions; risky variants are listed with clear cautions.

Homebrew, the macOS package manager, is installed via:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

After installation, packages can be installed with brew cask install <app_name>.

Advanced Tips

The article explains how to view command manuals with man <command>, how to drag files into the terminal to auto‑populate absolute paths, and how to customize terminal appearance via preferences.

It also warns that commands like sudo rm -rf / can irreversibly destroy a system, illustrated by a failed experiment on a Fedora VM that corrupted the author's Mac.

Conclusion

Terminal usage ranges from simple, harmless tasks that save time to powerful system‑level customizations; users are encouraged to approach it with respect and verify commands before execution.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

AutomationShellcommand-linemacOSSystem Administrationterminal
Architecture Digest
Written by

Architecture Digest

Focusing on Java backend development, covering application architecture from top-tier internet companies (high availability, high performance, high stability), big data, machine learning, Java architecture, and other popular fields.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.