- Published on
- · July 10, 2026
Terminal Commands: A Guide for Windows, Mac, and Linux
- Blog

- Henrico Piubello
- Henrico Piubello
- IT Specialist - Grupo Voitto
IT Specialist - Grupo Voitto

Terminal commands are text instructions that the operating system executes without a graphical interface. On Windows, they run in CMD (Command Prompt) or PowerShell; on Mac and Linux, in shells like Zsh and Bash. Mastering dir, cd, ls, and grep speeds up file, network, and automation tasks.
- What are terminal commands?
- What is the difference between the Windows, Mac, and Linux terminal?
- What are the main CMD commands on Windows?
- What are the main Terminal commands on a Mac?
- What are the main Linux commands?
- Why learn terminal commands in 2026?
What are terminal commands?
Terminal commands are the way to operate the computer through a CLI (Command-Line Interface): instead of clicking on windows and menus, you type instructions that the shell interprets and executes. Each command is a small program or an internal shell function, and most accept arguments and options that modify their behavior.
It's worth separating two concepts that often get mixed up. The terminal (or terminal emulator) is the window where you type and read the responses — Command Prompt and Windows Terminal on Windows, the Terminal app on Mac, GNOME Terminal or Konsole on Linux. The shell is the interpreter that runs inside that window: CMD and PowerShell on Windows, Zsh on Mac, Bash on most Linux distributions.
This text layer has existed since the early Unix systems of the 1970s and remains the most direct interface with the operating system: batch file manipulation, network diagnostics, process management, and routine automation are tasks where the command line outperforms the graphical interface in speed and reproducibility.
What is the difference between the Windows, Mac, and Linux terminal?
The central difference is the origin of the shells: Windows CMD inherits MS-DOS syntax, while Mac and Linux use Unix-family shells — which is why macOS and Linux commands are practically identical, and Windows ones have their own names. The table below shows the most-used equivalents:
| Task | Windows (CMD) | Mac and Linux |
|---|---|---|
| List files | dir | ls |
| Change directory | cd | cd |
| Copy file | copy | cp |
| Move or rename | move | mv |
| Delete file | del | rm |
| Create directory | mkdir | mkdir |
| Network config | ipconfig | ip addr, ifconfig |
| Clear the screen | cls | clear |
The ecosystem has evolved on all three systems. On Windows, Windows Terminal became the default terminal starting with Windows 11 22H2, according to Microsoft (2022), unifying CMD, PowerShell, and WSL in one app. On the Mac, Apple documents that Zsh has been the default shell since macOS Catalina, released in 2019, replacing Bash. On Linux, the GNU project's Bash remains the default shell on most distributions. For a broader comparison across the three systems, see our comparative analysis of Windows, Linux, and macOS.
What are the main CMD commands on Windows?
The fundamental CMD commands on Windows are dir, cd, mkdir, copy, del, and ipconfig: with them you navigate folders, create and remove files, and diagnose the network without opening a single Explorer window.
- dir — lists the files and folders in the current directory.
- cd — changes the working directory.
- mkdir — creates a new directory.
- copy — copies files from one location to another.
- del — deletes files.
- ipconfig — displays the network configuration (IP, gateway, DNS).
dir
cd C:\Projetos
mkdir relatorios
copy dados.txt C:\Projetos\relatorios\
del rascunho-antigo.txt
ipconfig /all
CMD also accepts diagnostic utilities like ping, tracert, and tasklist. The complete list, with every command's options, is in the official Windows command reference on Microsoft Learn. For more advanced automation — scripts, objects, and integration with services — the natural path is to migrate from CMD to PowerShell, which stays compatible with these commands through aliases.
What are the main Terminal commands on a Mac?
The essential Terminal commands on a Mac are ls, cd, cp, mv, rm, and top — the same basic set of any Unix system, run by default in the Zsh shell.
- ls — lists the files in the current directory.
- cd — navigates between directories.
- cp — copies files or directories.
- mv — moves or renames files.
- rm — removes files or directories.
- top — shows running processes and resource usage.
ls -la
cd ~/Documentos/projetos
cp config.json backup/config.json
mv rascunho.md artigo-final.md
rm arquivo-temporario.txt
top
Because macOS is a certified Unix system, almost everything you learn in the Mac Terminal also applies to Linux servers — and vice versa. The main practical difference is in system utilities: on the Mac, the most popular package manager is Homebrew, a topic we detail in the guide on package managers like npm, Homebrew, and Chocolatey. Take special care with rm: the command sends nothing to the Trash, deletion is permanent.
What are the main Linux commands?
The key Linux commands are pwd, ls, cp, mv, rm, and grep, typically run in the Bash shell. They cover the basic work cycle: know where you are, list and manipulate files, and search content inside them.
- pwd — displays the current directory path.
- ls — lists files and folders.
- cp — copies files or directories.
- mv — moves or renames files.
- rm — removes files or directories.
- grep — searches for text patterns inside files.
pwd
ls -lh /var/log
cp app.conf app.conf.bak
mv build/ releases/v2/
rm -r cache-antigo/
grep -r "erro" /var/log/nginx/
On Linux, the terminal isn't optional for those who administer systems: package installation (apt, dnf), permissions (chmod, chown), and services (systemctl) all go through the command line. It's also through it that you do secure remote access to servers via SSH, the dominant scenario in the cloud. Specialized distributions take this to the extreme: Kali Linux, aimed at security testing, concentrates hundreds of tools operated almost exclusively through the terminal.
Why learn terminal commands in 2026?
Learning terminal commands remains worthwhile because modern infrastructure is operated by text: the Unix family (Linux and derivatives) runs on 91.7% of sites whose operating system is known, according to W3Techs (July 2026). Anyone who deploys, debugs containers, or accesses cloud servers works, in practice, inside a shell.
On the desktop, the scenario is hybrid: the Stack Overflow Developer Survey 2024 recorded Windows as the most-used OS by developers (59.2% for personal use), with macOS at 31.8% — meaning the typical professional moves between CMD/PowerShell syntax on the local machine and Unix syntax on servers. Mastering both columns of this guide's table eliminates that friction.
There's also a multiplier effect: Git, Docker, package managers, and CI/CD (continuous integration and delivery) pipelines expose their primary interfaces as commands. Here at CodeCrush, we treat the terminal as the foundation: it's the skill that unlocks virtually every other day-to-day tool for those who program.
Conclusion
The terminal is the investment with the best return for anyone working in technology: a small set of commands — dir, cd, and ipconfig on Windows; ls, cp, mv, rm, and grep on Mac and Linux — covers most everyday tasks and pays off for decades, because these interfaces barely change. Start by using this guide's equivalence table as a cheat sheet, practice the examples in a test folder, and when the basic commands become reflex, move on to scripts and automation: that's the point where the command line stops being a convenience and becomes a competitive advantage.
## faq
Frequently asked questions
What is the difference between CMD and PowerShell?
CMD (Command Prompt) is the classic Windows interpreter, with syntax inherited from MS-DOS. PowerShell is more modern: it works with objects instead of plain text, accepts advanced scripts, and brings aliases like ls and cd. For automation on modern Windows, Microsoft recommends PowerShell.
Are the commands on Mac and Linux the same?
For the most part, yes. macOS and Linux descend from the Unix family, so commands like ls, cd, cp, mv, rm, and grep work the same on both. The differences appear in system tools (brew on Mac; apt or dnf on Linux) and in some options, since macOS uses BSD versions of the utilities.
How do I open the terminal on Windows, Mac, and Linux?
On Windows, press Win + R and type cmd, or search for "Windows Terminal" in the Start menu. On Mac, open Spotlight with Cmd + Space and type Terminal. On most Linux distributions, the Ctrl + Alt + T shortcut opens the default terminal emulator of the graphical environment.
Is it worth learning terminal commands in 2026?
Yes. Servers, Docker containers, Git, and CI/CD pipelines are mostly operated by command line. Since the Unix family dominates web servers, knowing how to navigate directories, manipulate files, and filter output with grep remains a practical requirement for development, data, and DevOps.
What is a shell and how does it differ from a terminal?
The shell is the program that interprets and executes commands, like Bash, Zsh, or PowerShell. The terminal is the window that displays that interaction: you type in the terminal and the shell processes it. On the Mac, for example, the Terminal app runs Zsh as the default shell since macOS Catalina.
Topics in this article
## continue lendo
Artigos relacionados
Keep browsing
Previous article

NumPy: what it is and what the Python library is for
NumPy is the Python library for numerical computing that provides multidimensional arrays and fast vectorized operations for data and science.
Read moreNext article

Package Managers: npm, Yarn, pnpm and More
Package managers automate installing and updating dependencies. Compare npm, Yarn, pnpm, Chocolatey, and Homebrew and learn which to use.
Read moreAbout the author



