If you can't navigate a Mac's desktop or run a simple command in a Linux terminal, you will be completely lost when an end user calls with a frozen screen or a server needs a simple file check. Understanding how to configure and use macOS and Linux operating systems is a core skill for a CompTIA A+ certified professional, because you will inevitably support both in a modern IT environment. This chapter breaks down the key differences and specific commands you need to know for the 220-1202 exam.
Jump to a section
A simple way to picture macOS and Linux Basics
An apartment building with a mix of residents, some in for the long haul and others just renting for a few months.
The building manager, let's call her Maria, keeps things running. She has two key ways to manage maintenance tasks. macOS is like the building's dedicated, on-site maintenance team, neatly uniformed, with a clear, user-friendly app on their phones to log and track every request. Maria can see the history of every repair for every apartment, and the team follows a standard procedure for everything from fixing a leaky tap to replacing a lightbulb. It's intuitive, predictable, and if a resident needs something, they can just shout and get help quickly. This represents macOS's graphical user interface (GUI), integrated applications, and user-friendly design.
Linux is like a different building across the street. The building manager, let's call him Jim, is a seasoned handyman who built the place. He uses a command-line interface (CLI) — a text-only, manual logbook. He doesn't have a fancy app; instead, he issues typed commands like 'FixType=leak Location=Unit3B' to the building's systems. It's incredibly powerful and customisable: Jim can write a script to automatically check every toilet's flush pressure every Tuesday, but he has to know the exact syntax for each command. This represents Linux's flexibility and its reliance on the command line. The manager's ability to control the building from a single, text-based central system, bypassing the need for a dedicated team, is the core analogy for how Linux works as an operating system.
macOS and Linux are two different types of operating systems (OS). An operating system is the master software that manages all the hardware and software on a computer. Think of it as the conductor of an orchestra — it tells the CPU (the brain), the memory (the short-term workspace), and the hard drive (the long-term storage) what to do and when to do it. Without an OS, you couldn't run applications like a web browser or a word processor.
macOS is made by Apple and is found only on Apple computers (MacBooks, iMacs, Mac Pros). It is known for its sleek, graphical user interface (GUI), which means you interact with it using your mouse or trackpad to click on icons, menus, and windows. It's designed to be user-friendly and usually 'just works' out of the box. Key features from the exam include the Dock (the bar of icons at the bottom), the Finder (which is like Windows' File Explorer), and Mission Control (a way to see all your open windows). You also need to understand the Mac's recovery modes: macOS Recovery (for reinstalling the OS) and Target Disk Mode (for transferring files between two Macs).
Linux is an open-source operating system, which means its underlying source code is freely available for anyone to see and modify. This has led to many different 'distributions' (or 'distros'), such as Ubuntu, Fedora, and CentOS. Unlike macOS, Linux is most famous for its command-line interface (CLI). This is a text-based way to interact with the system by typing commands into a 'terminal' or 'shell'. Instead of clicking a 'Delete' button, you might type 'rm filename'. While scary at first, the CLI is incredibly powerful and efficient for managing servers and performing automated tasks, which is why Linux dominates the world of servers (the computers that run websites and databases).
The exam focuses heavily on basic Linux commands. Here are the absolute essentials:
ls: Lists the contents of a directory (like a folder). For example, 'ls' shows you all files in your current location.
cd: Changes the directory. For example, 'cd Documents' moves you into the Documents folder.
pwd: Prints the working directory — it tells you exactly where you are in the file system.
mkdir: Makes a new directory. For example, 'mkdir NewFolder' creates a folder called NewFolder.
rm: Removes a file or directory. Be careful: this is permanent. There is no 'Recycle Bin'.
cp: Copies a file. For example, 'cp file1.txt file2.txt' makes a copy of file1.txt called file2.txt.
mv: Moves or renames a file.
cat: Concatenates and displays the contents of a file. For example, 'cat notes.txt' prints the text inside notes.txt.
chmod: Changes the permissions of a file (who can read, write, or execute it).
Both macOS and Linux have a hierarchical file system, starting from the 'root' directory (represented by a single forward slash '/'). Everything — your personal files, applications, system configurations — lives underneath this root in a tree-like structure. For macOS, the root contains folders like 'Applications', 'System', and 'Users'. In Linux, it contains folders like 'bin' (essential command binaries), 'etc' (configuration files), 'home' (user home directories), and 'var' (variable data like logs).
Why do you need this for the 220-1202 exam? The exam will present you with a scenario, like 'A user's Mac won't boot past the Apple logo' or 'A Linux server needs to have its log files checked'. You need to know which tool or command to use. For macOS, this might be holding Command-R to boot into macOS Recovery. For Linux, this might be the 'tail' command to view the end of a log file. The exam also tests your ability to identify common graphical interface elements on macOS and basic file management tasks in the Linux terminal.
Opening a Linux Terminal
The first step for any command-line task. You open the terminal application, which provides a shell (like Bash or Zsh) where you type commands. This is the central interface for managing a Linux system.
Navigating the File System with 'cd' and 'ls'
You use 'pwd' to see your current location. Then you use 'ls' to see what files and folders are there. Then you use 'cd <directory name>' to move into a different folder. This is how you find the files you need to work with.
Checking File Permissions
Type 'ls -l' to see detailed information, including file permissions (e.g., -rwxr-xr--). This step is critical for diagnosing why a user cannot access a file or run a script. The permissions show who (owner, group, others) can read, write, or execute the file.
Modifying File Permissions with 'chmod'
If a script cannot be executed, you run 'chmod +x script.sh' to grant execute permission. If a file is world-readable and shouldn't be, you run 'chmod 700 secret.txt' to make it readable only by the owner. This is a common administrative task.
Viewing and Searching Log Files
You navigate to the /var/log directory using 'cd'. You use 'ls' to find the log file (e.g., syslog, auth.log). Then you use 'tail -n 50 syslog' to see the last 50 lines. If you are searching for a specific error, you use 'grep "error" /var/log/syslog'. This is how you troubleshoot issues.
Installing Software with a Package Manager
On an Ubuntu system, you first update the package list with 'sudo apt update'. Then you install a new application with 'sudo apt install nginx'. This is the safe, standard way to add software, as opposed to downloading random scripts from the internet.
You are a junior IT support technician at a small marketing agency. You get a ticket from a graphic designer, Sarah, because her iMac is running slowly. First, you ask her to open 'Activity Monitor', a built-in macOS utility that shows what's using the computer's resources (CPU, memory, disk, network). She tells you that a process called 'Adobe Creative Cloud' is using 95% of the CPU. You advise her to quit it from within Activity Monitor. This is a real-world use of macOS system utilities.
Later that same day, your senior colleague asks you to check the Apache web server log on a Linux server that hosts the company's main website. You don't have a GUI — you have to SSH (Secure Shell) into the server. SSH is a protocol for securely logging into a remote computer.
Here is the step-by-step process you would follow:
You open a terminal (Terminal.app on Mac, or an SSH client like PuTTY on Windows).
You type: ssh username@192.168.1.100 (replacing the username and IP address with the server's details). After entering your password, you're connected to the server's Linux command line.
You need to navigate to the log directory. You use the 'cd' command: 'cd /var/log'. The 'var' directory contains variable data, and 'log' is where log files are kept. You then use 'ls' to list the files. You see 'apache2' as a directory name.
You change into it: 'cd apache2'. Now you use 'ls' again and see 'access.log' and 'error.log'.
To check the most recent entries in 'access.log', you use the 'tail' command: 'tail -20 access.log'. The '-20' flag tells it to show the last 20 lines. If you wanted to watch the log in real-time as new visitors arrive, you would use 'tail -f access.log'.
You find a pattern of 404 errors. You report this back, showing that you can diagnose a web server issue from the command line.
This scenario shows the real-world difference: macOS is the user's everyday desktop; Linux is the powerful server on the back end. An A+ certified professional must be comfortable with both environments. You will also use 'chmod' to fix permission issues on a Linux file, 'cp' to backup a configuration file before editing it, and 'rm' with extreme caution to remove a temporary file. Another common task is using 'ps' (process status) to see running processes, and 'kill' to stop a misbehaving process by its Process ID (PID).
The CompTIA A+ 220-1202 exam specifically tests your ability to 'configure and use' macOS and Linux. This means more than just knowing what they are — you must know the exact steps and commands for common tasks. The exam is scenario-based, so you will be given a situation and asked to choose the best tool, command, or sequence of actions.
Here are the specific concepts they love to test and how they set traps:
macOS Best Practices: They love testing your knowledge of 'Backup / Time Machine' and 'Restore / macOS Recovery'. A typical trap question might describe a Mac that won't boot. The correct answer is often 'Boot from macOS Recovery' (by holding Command-R at startup). They might try to trick you with 'Safe Mode' (holding Shift) which is for a different issue (like a corrupted login item).
Linux Terminal Commands: This is the biggest area for Linux. You must know the exact command for the exact task. They test 'cp' for copy, 'mv' for move/rename, 'rm' for delete, 'mkdir' for create directory, 'chmod' for change permissions, 'chown' for change owner, 'ls' for list, 'cd' for change directory, 'pwd' for print working directory, 'grep' for searching text, 'find' or 'locate' for finding files, 'ps' for process list, 'kill' for stopping a process, 'apt-get' or 'yum' for software installation (depending on the distribution), 'ifconfig' or 'ip' for network configuration, and 'passwd' for changing passwords.
Graphical Interfaces (macOS): You must be able to identify and explain common macOS GUI elements: 'Finder', 'Dock', 'Mission Control', 'Spotlight', 'System Preferences', 'Keychain', and 'Disk Utility'.
File Systems and Paths: The exam will test your understanding of the Linux hierarchical file system. A common trap is asking for the fully qualified path to a user's home directory. The correct answer is '/home/username' (for a standard Linux system) or '/Users/username' (for macOS). The root directory is always '/'.
Permissions: They love Linux file permissions. You must understand the 'rwx' (read, write, execute) system and how to interpret a permission string like 'rwxr-xr--' (owner: read, write, execute; group: read, execute; others: read only). They will test you on using 'chmod' with both symbolic (like 'chmod u+x') and numeric (like 'chmod 755') modes.
Key Differences: The exam expects you to know that macOS is built on a Unix foundation (similar to Linux) but has a proprietary GUI and a different set of utilities (like 'Disk Utility' vs 'fdisk'). Knowing that macOS uses a different case-insensitive file system by default (APFS) can also be a test point.
Traps: One common trap is to confuse Linux commands with Windows commands. For example, 'dir' is a Windows command — in Linux it is 'ls'. Another trap is to confuse 'restart' commands — 'shutdown -r now' in Linux vs a restart button in macOS. A third trap involves assuming all Linux distributions use the same package manager. While 'apt-get' is common on Debian/Ubuntu, 'yum' or 'dnf' is used on Red Hat/CentOS/Fedora.
To succeed, memorise the command list and practise writing them out. Focus on the scenario: if a user 'cannot access a file', the answer is likely 'chmod'; if a 'process is frozen', the answer is 'kill' or 'killall'; if a 'service is failing to start', the answer might be 'systemctl' or 'journalctl'.
macOS uses a graphical user interface (GUI) for user interaction, while Linux is primarily managed through a command-line interface (CLI).
The root directory in both macOS and Linux is represented by a single forward slash (/) and contains all other directories.
To boot a Mac into macOS Recovery, hold down Command (⌘) and R keys immediately after the startup chime.
The Linux command 'ls -la' lists all files (including hidden ones) with detailed permissions, sizes, and timestamps.
To change file permissions in Linux, use 'chmod' followed by the permission code (e.g., 'chmod 755 script.sh' gives owner full control, others read/execute).
Always use 'pwd' to check your current directory before running destructive commands like 'rm' to avoid deleting the wrong files.
Time Machine is macOS's built-in backup utility that automatically saves hourly, daily, and weekly backups to an external drive or network location.
The Linux 'grep' command is used to search for specific text patterns within files, making it a powerful tool for log analysis.
These come up on the exam all the time. Here's how to tell them apart.
Linux 'ls' command
Lists files and directories in the current location.
Case-sensitive by default (File and file are different).
Common flags: -l (long format), -a (show hidden files).
Windows 'dir' command
Lists files and directories in the current location.
Case-insensitive by default.
Common switches: /w (wide format), /p (pause after each screen).
macOS Recovery Mode (Command-R)
Used for reinstalling macOS, restoring from backup, and using Disk Utility.
Boots from a hidden recovery partition.
Ideal for corrupted system files or a completely unbootable system.
Safe Mode (Shift key)
Used to boot with only essential kernel extensions and startup items disabled.
Forces a directory check on the startup drive.
Ideal for diagnosing problems caused by third-party software or corrupt cache files.
Linux 'cp' command
Duplicates a file or directory to a new location.
Original file remains unchanged after the operation.
Syntax: cp source destination
Linux 'mv' command
Moves a file or directory to a new location, or renames it.
Original file is deleted from the source location.
Syntax: mv source destination
Package Manager 'apt' (Debian/Ubuntu)
Uses .deb package format.
Commands: apt-get install, apt-get update.
Newer versions use 'apt' as a user-friendly front-end.
Package Manager 'yum' (Red Hat/CentOS)
Uses .rpm package format.
Commands: yum install, yum update.
Its successor is 'dnf', but 'yum' is still heavily tested.
Mistake
Linux is just a free version of Windows with a different look.
Correct
Linux is a completely separate operating system kernel with its own file system structure, command set, and philosophy. It does not run Windows software natively.
Beginners often assume all operating systems work the same way, and they see a GUI and assume it's like Windows. The exam tests the deeper command-line differences.
Mistake
Macs never get viruses, so there is no need for macOS security tools.
Correct
macOS is built on a Unix-like core with strong security features, but it is still vulnerable to malware, phishing, and other threats. It requires antivirus software and regular updates.
This myth persists because of Apple's long-standing marketing and relatively lower market share for malware. The exam emphasises the need for security best practices on all platforms.
Mistake
The 'ls' command is dangerous and can delete all your files.
Correct
'ls' simply lists the contents of a directory. It is a safe, read-only command. The dangerous command is 'rm -rf /*', which recursively removes all files from the root.
Beginners hear about the power of the terminal and conflate harmless listing commands with destructive deletion commands, causing unnecessary fear.
Mistake
You need to install a new Linux distribution to get the latest software.
Correct
Most modern Linux distributions use a package manager (like apt-get, yum, or zypper) to install, update, and remove software without reinstalling the whole OS.
Beginners coming from Windows, where reinstalling the OS is common for major updates, assume the same pattern applies to Linux. The exam tests package management commands.
Mistake
macOS Recovery is the same as reinstalling the entire operating system.
Correct
macOS Recovery offers multiple utilities: reinstalling macOS, restoring from a Time Machine backup, using Disk Utility, and accessing a terminal. It is a recovery environment, not just a reinstaller.
The term 'Recovery' implies a full reset to many users, but the exam tests the specific tools within that environment.
Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.
No. For CompTIA A+, you only need to know the specific commands and their syntax (like ls, cd, chmod, grep). You do not need to write complex scripts.
'shutdown' is the recommended way to bring the system down gracefully, sending messages to logged-in users. 'halt' simply stops the CPU without properly shutting down services, and should be avoided for normal use.
Yes. macOS is built on a Unix foundation, so many Linux commands work identically in the macOS Terminal. You can also install a Linux distribution on a Mac using a virtual machine or a dual-boot setup.
'sudo' stands for 'superuser do'. It allows an authorised user to execute commands with the privileges of the root (administrator) account. It is a security mechanism to prevent accidental damage.
If you are in a virtual console, pressing Ctrl + Alt + F7 usually returns you to the graphical desktop. In most modern desktop environments, you simply close the terminal window.
This usually means the program you are trying to run is not installed, or the command is not in your PATH environment variable. On A+, the most common reason is that you are trying to use a command from a different distribution.
You've finished macOS and Linux Basics. Continue through the 220-1202 study guide to build a complete picture of the exam.
Done with this chapter?