macOS / Guide

The advanced Mac toolbox: Terminal, Homebrew, launchd, SSH, SMB sharing, virtualisation and containers

The tools that make a Mac a real administration workstation: Terminal and zsh, Homebrew and the Brewfile to rebuild a Mac in one command, little-known built-in commands, your own automatic tasks with launchd, SSH and Screen Sharing, SMB sharing with a NAS, virtualisation with UTM, Linux containers with Apple's tool, and the end of Rosetta.

macOS Guide Advanced Published October 20, 2026 Translated November 20, 2026 18 min read Version française
A MacBook Pro displaying code
Photo: Emile Perron on Unsplash

Before you start

In plain words

Under its elegant bodywork, the Mac is a complete Unix system. Terminal is its service entrance: behind it lies a whole workshop, with a package manager, a task scheduler, an SSH server and what you need to run other systems. This guide takes you round the workshop.

1. Terminal and zsh

The default shell on macOS is zsh. Its personal configuration goes in ~/.zshrc:

# ~/.zshrc: a few useful settings
export EDITOR=nano
alias ll='ls -lahG'
alias update='brew update && brew upgrade && brew cleanup'
setopt HIST_IGNORE_DUPS SHARE_HISTORY   # history shared between tabs
autoload -Uz compinit && compinit        # advanced completion

Reload with source ~/.zshrc. The classic Unix commands work (see Linux commands for beginners), with a few differences: macOS tools are the BSD ones, not GNU (sed -i '' instead of sed -i, different options for ls and date).

Handy moves in Terminal:

Move Effect
Drag a file into the window Inserts its full path
Cmd + click on a URL or a path Opens it
Cmd + K Clears the screen and the scrollback
Ctrl + R Searches the history
open . Opens the current folder in the Finder

2. Homebrew: the package manager

Homebrew installs command-line tools and applications ("casks") from an open source community repository, along with their updates.

/bin/bash -c "$(curl -fsSL \
  https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

This is the command from the official website, split over two lines; a .pkg installer is also offered on the project's GitHub page. On an Apple silicon Mac, Homebrew installs into /opt/homebrew; follow the instruction shown at the end of the installation to add it to the PATH.

brew search wireshark            # search
brew install wget htop nmap      # command-line tools
brew install --cask vlc keepassxc   # applications
brew upgrade                     # update everything
brew cleanup                     # remove old versions
brew doctor                      # diagnose the installation

Rebuilding a Mac in one command: the Brewfile lists all your packages and applications.

brew bundle dump --file=~/Brewfile    # export
brew bundle --file=~/Brewfile         # reinstall on a new Mac

Keep this file with your backups: after a reinstall or on a new Mac, all your tools come back with one command. It's the equivalent of winget export on Windows (see The advanced Windows toolbox).

3. Little-known built-in commands

Command Use
caffeinate -d -t 3600 Stops the display from sleeping for an hour
pbcopy / pbpaste Clipboard: pbcopy < file.txt copies a file's contents
open -a "Preview" image.png Opens a file with a specific application
mdfind "kind:pdf invoice" Spotlight search from the command line
networkQuality Built-in network throughput and responsiveness test
sips -s format jpeg photo.heic --out photo.jpg Converts and resizes images
textutil -convert docx note.rtf Converts text documents
hdiutil create -srcfolder folder archive.dmg Creates a disk image
plutil -p file.plist Displays a plist file readably
shortcuts run "Shortcut name" Runs a shortcut from the Shortcuts app
screencapture -i capture.png Screenshot from the command line
say "Backup finished" Spoken announcement at the end of a script

4. Your own automatic tasks with launchd

On a Mac, you don't schedule a task with cron but with a launchd agent: a .plist file in ~/Library/LaunchAgents. Example: run a backup script every day at 1 pm.

Step 1. Create the file ~/Library/LaunchAgents/net.spotech.backup.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
  "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>net.spotech.backup</string>
  <key>ProgramArguments</key>
  <array>
    <string>/bin/zsh</string>
    <string>/Users/spo/scripts/backup.sh</string>
  </array>
  <key>StartCalendarInterval</key>
  <dict>
    <key>Hour</key><integer>13</integer>
    <key>Minute</key><integer>0</integer>
  </dict>
  <key>StandardOutPath</key>
  <string>/Users/spo/Library/Logs/backup.log</string>
  <key>StandardErrorPath</key>
  <string>/Users/spo/Library/Logs/backup.log</string>
</dict>
</plist>

Step 2. Check the syntax, then load the agent:

plutil -lint ~/Library/LaunchAgents/net.spotech.backup.plist
launchctl bootstrap gui/$(id -u) \
  ~/Library/LaunchAgents/net.spotech.backup.plist

Step 3. Test it without waiting for the scheduled time, then check the log:

launchctl kickstart gui/$(id -u)/net.spotech.backup
tail ~/Library/Logs/backup.log

Unlike cron, launchd catches up on a task missed during sleep as soon as the Mac wakes. To remove the agent: launchctl bootout gui/$(id -u)/net.spotech.backup. If the script reads protected folders (Documents, Desktop), grant Full Disk Access to /bin/zsh or to Terminal (see Security and privacy on the Mac).

5. SSH and Screen Sharing

Connecting to other machines. Create a modern key and a configuration file:

ssh-keygen -t ed25519 -C "spo@mac"
ssh-copy-id spo@10.10.30.10
# ~/.ssh/config
Host *
  UseKeychain yes
  AddKeysToAgent yes
  IdentityFile ~/.ssh/id_ed25519

Host nas
  HostName 10.10.30.10
  User spo

UseKeychain stores the key's passphrase in the keychain: no need to type it again. ssh nas is then enough.

Administering the Mac remotely. System Settings › General › Sharing:

  • Remote Login turns on the SSH server; limit it to the users who need it;
  • Screen Sharing allows graphical control (VNC protocol) from another Mac (Finder › Cmd + K › vnc://address) or a VNC client.

As with any remote access, never expose these services to the internet: go through a VPN. See Remote access: RDP, VNC, SSH and Securing SSH access.

6. SMB file sharing and NAS

Connecting to a share: Finder › Cmd + K, then smb://nas.local/Share or smb://10.10.30.10/Share. Click + to add it to favourites. To mount it automatically at login, add the mounted volume in System Settings › General › Login Items & Extensions › Open at Login.

Sharing a folder from the Mac: System Settings › General › Sharing › File Sharing, add the folder and the allowed users. macOS shares over SMB, compatible with Windows and Linux.

Time Machine on a NAS: most NAS systems (TrueNAS, OpenMediaVault, Synology, QNAP) offer an SMB share flagged as "Time Machine". The Mac then sees it as a backup disk (see Backing up your Mac with Time Machine and TrueNAS, OpenMediaVault, Unraid).

Avoiding stray files on network shares (.DS_Store):

defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true

7. Virtualisation

An Apple silicon Mac runs ARM virtual machines: ARM Linux, macOS, and Windows 11 on ARM. x86 systems only run under emulation, which is much slower.

Tool Licence Use
UTM Open source, free Linux and macOS virtualised through Apple's framework; x86 emulation possible with QEMU
VirtualBox Open source Available for Apple silicon, ARM guests only
Parallels Desktop Commercial The most polished option for Windows 11 on ARM and desktop integration
VMware Fusion Proprietary, free Linux and Windows on ARM
brew install --cask utm

For the principles, see Virtual machines and hypervisors explained simply.

8. Linux containers

Apple's container tool, free and hosted on GitHub, runs Linux containers in the standard OCI format (the same images as Docker) on an Apple silicon Mac running macOS 26 or later. What sets it apart: each container runs in its own lightweight virtual machine, which isolates it better than a classic container. Version 1.0 came out in July 2026.

Install the signed package (.pkg) from the releases page of the apple/container project on GitHub, then:

container system start
container run --rm -it docker.io/library/debian:stable bash

The alternatives: Docker Desktop (the most widespread, paid licence for businesses above a certain size), Podman Desktop (open source, daemonless), OrbStack (lightweight, commercial). Compose files and Docker commands are covered in Essential Docker commands.

9. The end of Rosetta

Rosetta translates applications built for Intel Macs on the fly. Apple has announced that macOS 27 is the last version to offer it generally. Prepare for what comes next:

Step 1. List the apps that are still Intel: System Information › Software › Applications, then sort on the "Kind" column (Apple Silicon, Universal or Intel).

Step 2. For each, look for an Apple silicon or universal version from the publisher, or a native alternative (with brew search).

Step 3. For line-of-business software with no native version, consider a virtual machine or a dedicated Windows or Linux workstation.

10. Summary

Tool Installation Windows equivalent
Terminal, zsh Built in Windows Terminal, PowerShell
Homebrew, Brewfile Script on brew.sh winget, winget export
launchd Built in Task Scheduler
SSH, Remote Login Built in OpenSSH Server
Screen Sharing Built in Remote Desktop
SMB file sharing Built in Windows file sharing
UTM brew install --cask utm Hyper-V
Apple's container .pkg package on GitHub WSL with Docker or Podman

Read next