Linux and macOS Support Essentials
Supporting the other operating systems: macOS and Linux for the technician who mostly knows Windows. Key differences, the file system and permissions, the terminal commands that matter, package managers and updates, user and disk management, networking and logs, the Apple-specific tools (Disk Utility, Recovery, System Settings, MDM), and a troubleshooting approach.
You will be asked about them
Even in a Windows office, there are designers on Macs, developers on Linux, servers running Linux and a manager who just bought a MacBook. You do not need to be an expert, but you need enough to diagnose, fix common problems and know when to escalate. The good news: macOS and Linux share a Unix heritage, so one set of ideas covers both.
(For a deeper Linux treatment, take the Linux & Systems Engineering course. The operating systems lesson earlier in this course introduced the three families.)
How they differ from Windows
| Windows | macOS | Linux | |
|---|---|---|---|
| File system root | Drive letters (C:\) |
One tree starting at / |
One tree starting at / |
| Paths | C:\Users\Ada\Documents |
/Users/ada/Documents |
/home/ada/Documents |
| Path separator and case | Backslash, not case-sensitive | Forward slash; usually case-insensitive (APFS default) | Forward slash; case-sensitive |
| Admin rights | UAC prompt; Administrators group | Admin users and password prompts; sudo |
root and sudo |
| Software installation | Installers, Microsoft Store, winget | App bundles, the App Store, Homebrew, packages | Package manager (apt, dnf, pacman) |
| System settings | Settings, Control Panel, registry | System Settings, plists, defaults, profiles |
Config files in /etc, the settings app of the desktop |
| Services | Services, Task Scheduler | launchd (LaunchDaemons/Agents) | systemd |
| Logs | Event Viewer | Console app, log command |
journalctl, /var/log |
| Management | AD, Intune, Group Policy | MDM (Jamf, Intune, Kandji), configuration profiles | Configuration management (Ansible), MDM less common |
The terminal
Open Terminal (macOS: Applications > Utilities; Linux: your desktop’s terminal). The shell is usually zsh on macOS and bash on most Linux systems. The commands below work in both.
Moving around and looking
pwd # where am I?
ls -la # list files, including hidden ones, with details
cd /var/log # change directory (cd ~ is your home; cd - the previous one)
cat file.txt # show a file
less /var/log/syslog # page through a long file (q to quit)
tail -f /var/log/system.log # follow a log as it grows
head -n 20 file # first lines
find / -name "*.conf" 2>/dev/null # find files by name
grep -ri "error" /var/log/ | head # search inside files
Files and folders
mkdir projects # make a folder
cp file.txt backup.txt # copy
mv old.txt new.txt # move or rename
rm file.txt # delete (no recycle bin!)
rm -r folder # delete a folder and everything in it: be careful
du -sh ~/Downloads # size of a folder
df -h # free space on each disk
There is no undo for rm. Check twice, especially with wildcards, and never run rm -rf with a path you have not verified.
Help
man ls # the manual page
ls --help # short usage (Linux); on macOS `man ls` works best
Permissions and ownership
Every file has an owner, a group and permissions for owner / group / others:
-rwxr-xr-- 1 ada staff 2048 Oct 21 09:30 report.sh
||| ||| |
||| ||| +-- others: r-- (read)
||| +------ group: r-x (read, execute)
+---------- owner: rwx (read, write, execute)
r read, w write, x execute (for a directory, x means “may enter it”). Numeric form: r=4, w=2, x=1, so rwxr-xr-- is 754.
chmod 644 notes.txt # owner read/write, others read
chmod u+x script.sh # add execute for the owner
chown ada:staff file.txt # change owner and group (needs sudo)
ls -l # see permissions
id # who am I and which groups?
Typical faults: “Permission denied” (the user lacks the right permission or is not in the right group), a script that “does nothing” (not executable: chmod +x), an application that cannot write to its folder (wrong owner). Do not “fix” problems with chmod -R 777: it opens everything to everybody and is a security hole.
sudo
sudo apt update # run one command with administrator rights (you enter YOUR password)
sudo -l # what am I allowed to run?
sudo gives temporary elevation, is logged, and is much safer than working as root. Only users in the right group (sudo, wheel or admin) can use it.
Software and updates
Linux package managers
| Family | Tool | Examples |
|---|---|---|
| Debian, Ubuntu | apt |
sudo apt update && sudo apt upgrade, sudo apt install htop, apt search, sudo apt remove |
| Red Hat, Fedora, Rocky | dnf |
sudo dnf check-update, sudo dnf install htop |
| Arch | pacman |
sudo pacman -Syu |
Always refresh the package list before installing (apt update), prefer packages from the official repositories, and be careful adding third-party repositories (each one is trusted with root access).
macOS software
- App Store and drag-and-drop
.appbundles (and.pkginstallers). - Homebrew (
brew install wget,brew upgrade) is the common package manager for developers. - Software Update in System Settings; managed Macs often have updates controlled by MDM.
- Gatekeeper blocks unsigned or unnotarised apps; “app can’t be opened because it is from an unidentified developer” is Gatekeeper working, not a fault. Do not turn it off; an administrator can allow a trusted app.
- Rosetta 2 lets Intel apps run on Apple silicon Macs.
Users, disks and processes
whoami # current user
who # who is logged in
sudo useradd -m -s /bin/bash newuser # Linux: create a user (macOS uses System Settings or `sysadminctl`)
sudo passwd newuser # set a password (Linux)
lsblk # Linux: disks and partitions
diskutil list # macOS: disks and volumes
ps aux | head # processes
top # live processes (q to quit); on macOS `top -o cpu`
kill 1234 # ask a process to stop; kill -9 1234 forces it
uptime # how long running, and the load
free -h # Linux memory; macOS: vm_stat or Activity Monitor
Networking
ip addr # Linux: IP addresses (macOS: ifconfig, or networksetup -listallhardwareports)
ip route # routing table / default gateway (macOS: netstat -rn)
ping -c 4 8.8.8.8
nslookup example.com # or: dig example.com
traceroute example.com
ss -tulpn # Linux: listening ports and the programs using them (macOS: lsof -i -P | grep LISTEN)
curl -I https://example.com # fetch headers: is the web server answering?
sudo systemctl restart networking # Linux: restart a service (systemd)
The same ordered approach from the networking lesson applies: link, IP address and gateway, DNS, then the application.
Logs and services
- Linux:
journalctl -xe(recent errors),journalctl -u ssh(one service),/var/log/syslogormessages,/var/log/auth.logfor sign-ins; services are managed withsystemctl status|start|stop|restart|enable <name>. - macOS: the Console app,
log show --last 1h --predicate 'eventMessage contains "error"', and Activity Monitor for processes; services run under launchd, managed withlaunchctl. - A full disk is a frequent hidden cause of odd behaviour on both. Check
df -hbefore anything fancy.
macOS support tools and procedures
- System Settings (formerly System Preferences): network, users, privacy (many “can’t do X” problems on macOS are a missing privacy permission for screen recording, accessibility, files and folders, or the camera).
- Activity Monitor: CPU, memory, energy, disk and network use per process; force quit runaway apps.
- Disk Utility: check and repair disks (First Aid), erase and format (APFS), manage volumes.
- Force Quit (Cmd+Option+Esc), Safe Mode (disables third-party extensions: held Shift on Intel, an Apple-silicon start-up options route), Spotlight reindexing, resetting PRAM/NVRAM (Intel).
- macOS Recovery: boot to it (Apple silicon: hold the power button until start-up options appear; Intel: Cmd+R). It offers Disk Utility, Time Machine restore, Terminal and Reinstall macOS (keeps data by default). Check FileVault (disk encryption) and the recovery key before wiping, and respect Activation Lock and MDM enrolment on company Macs.
- Time Machine backups for personal Macs; organisations often rely on cloud storage and endpoint backup instead.
- FileVault encrypts the disk; make sure the recovery key is escrowed to your management system.
- Managed Macs: MDM (Jamf, Intune, Kandji) applies configuration profiles, restrictions and apps; Apple Business Manager and automated device enrolment configure Macs on first boot. Check Profiles in System Settings to see what is applied.
- Keychain Access holds passwords and certificates; “keeps asking for the keychain password” often follows a password change that left the login keychain out of sync.
- Safari and Mail have their own settings; iCloud and Apple ID (managed Apple IDs for organisations) affect sync and activation.
Linux support notes
- Distribution matters: Ubuntu, Debian, Fedora, Red Hat and others differ in package tools and defaults. Find out which with
cat /etc/os-release. - Desktop versus server: servers may have no graphical interface; you work over SSH (
ssh user@host), with key authentication where possible. - Boot problems: GRUB menu, recovery or rescue mode,
fsckfor file-system errors, checking/etc/fstabafter disk changes. - Kernel and software updates may require a reboot; schedule it.
- Firewall:
ufworfirewalld; before changing it over SSH, make sure you will not lock yourself out. - SELinux/AppArmor can block things that look like permission errors even when file permissions are right.
Troubleshooting approach
The same method as before applies: define the problem, check what changed, gather information, form a hypothesis, test one thing at a time, verify, document. Unix-specific habits:
- Read the error message exactly; search for it.
- Check disk space and permissions early.
- Look at the logs for the time of the fault.
- Reproduce from the terminal where possible (a command shows the real error that a GUI hides).
- Do not fix with brute force (
chmod 777, running everything as root, disabling the firewall or security features). Find the cause. - Back up before big changes, and make a note of what you changed.
- Escalate when you reach the edge of your authority or knowledge, with your evidence.
Staying safe
- Use
sudodeliberately, and read a command before pasting it (especiallycurl ... | sudo bashsnippets from the internet). - Keep systems patched and use disk encryption on laptops.
- Do not share your admin password; use your own account.
- Verify downloads (official sites, checksums) before installing.
A user on Ubuntu says a shell script run from the terminal says 'Permission denied', although they own the file. What do you check?
Whether the script has the execute permission (ls -l shows no x), and add it with chmod u+x script.sh if appropriate. Also check that the directory is not mounted with noexec, that the path or interpreter line (the shebang) is correct, and whether a security module (AppArmor or SELinux) is blocking it. Running it with an explicit interpreter (bash script.sh) tests the difference.
Can You Explain It?
Close the lesson and answer these without looking back. The goal isn't the wording — it's whether you've formed a usable mental model.
- Explain how to read the permission string -rwxr-x--- and what chmod 640 would change.
- Describe three Linux or macOS commands you would run first for 'my computer is slow' and why.
- Why is sudo preferable to logging in as root, and why is chmod -R 777 a bad fix?
Hands-on practice
Write the functions marked TODO. The checks read the variables your program leaves behind, so keep the lines at the bottom as they are, run it, then press Check my work.
🧪 Want to practise this on your own computer? See how to set up your lab →