Mac Terminal Errors — Common Command-Line Errors and Fix Guide
Informationalapplication
Overview
Fix common Mac Terminal errors including 'command not found', 'permission denied', PATH issues, shell configuration problems, and zsh vs bash differences.
Key Details
- macOS uses zsh as the default shell since macOS Catalina (previously bash)
- Configuration file is ~/.zshrc for zsh (not ~/.bashrc or ~/.bash_profile)
- PATH determines which commands are available — Homebrew adds /opt/homebrew/bin to PATH
- 'command not found' usually means the tool is not installed or not in PATH
- 'Operation not permitted' in Terminal may require Full Disk Access permission
Common Causes
- Command not installed or its path not in the shell's PATH variable
- Using bash configuration files (.bashrc) when the shell is zsh
- Homebrew PATH not configured: /opt/homebrew/bin not in PATH on Apple Silicon
- Permission denied on scripts missing execute permission (chmod +x needed)
- Terminal lacking Full Disk Access for operations on protected directories
Steps
- 1Check which shell: echo $SHELL (should show /bin/zsh on modern macOS)
- 2Fix PATH for Homebrew: add eval "$(/opt/homebrew/bin/brew shellenv)" to ~/.zshrc
- 3After editing ~/.zshrc: source ~/.zshrc or open a new terminal window
- 4Fix 'command not found': verify installation with which <command> or brew install <command>
- 5Fix 'permission denied': chmod +x script.sh to add execute permission
- 6Grant Full Disk Access to Terminal: System Settings > Privacy & Security > Full Disk Access > add Terminal
Tags
terminalzshcommand-not-foundpathshell
Related Items
More in Application
windows-C0000005-access-violationWindows Error 0xC0000005 — Access Violation
Errorwindows-C000007B-bad-image-formatWindows Error 0xC000007B — Bad Image Format
Errorwindows-C0000142-application-init-failedWindows Error 0xC0000142 — Application Init Failed
Errorwindows-SxS-Error-side-by-side-configuration-errorWindows Error SxS-Error — Side-by-Side Configuration Error
Warningwindows-DLL-Missing-dll-not-foundWindows Error DLL-Missing — DLL Not Found
Warningwindows-app-runtime-r6025Windows Runtime Error R6025 — Pure Virtual Function Call
WarningFrequently Asked Questions
Apple switched to zsh in Catalina because newer bash versions use GPLv3 license which Apple cannot bundle. Zsh is mostly compatible with bash but uses different config files (.zshrc vs .bashrc).