REMOVE COMPLETELY via iTerminal
rewritten in html language, for iTerminal command prompt
🛠️ Mac Terminal Guide: Find & Completely Remove Installed Apps (npm & Homebrew)
My personal cheat sheet for finding, uninstalling, and completely removing apps installed via Terminal on macOS.
📌 Step 1: Find Where the App Is Installed
Replace appname with the application name (example: codex, yarn, pnpm, etc).
command -v appname which appname type -a appname
Example:
command -v codex which codex type -a codex
📌 Step 2: Check if Installed via Homebrew
Search installed formulas:
brew list | grep appname
Get detailed information:
brew info appname
📌 Step 3: Check if Installed via npm
npm list -g --depth=0 | grep appname
Example:
npm list -g --depth=0 | grep codex
📌 Step 4: Remove the App
🍺 Remove from Homebrew
brew uninstall appname
If installed as a cask:
brew uninstall --cask appname
📦 Remove from npm
npm uninstall -g appname
Example:
npm uninstall -g @openai/codex
📌 Step 5: Clear Shell Cache
Sometimes Terminal still thinks the app exists after uninstalling.
hash -r
📌 Step 6: Verify That the App Is Gone
command -v appname || echo "✅ App removed successfully"
📌 Step 7: Search for Leftover Files
find ~/.appname /opt/homebrew -iname "*appname*" 2>/dev/null
Example:
find ~/.codex /opt/homebrew -iname "*codex*" 2>/dev/null
📌 Step 8: Remove Leftover Files
⚠️ WARNING: Double-check before running rm -rf!
rm -rf ~/.appname rm -rf /opt/homebrew/.appname
Example:
rm -rf ~/.codex rm -rf /opt/homebrew/.codex
📌 Step 9: Final Verification
hash -r command -v appname type -a appname
If nothing is returned, the application has been completely removed from the system.
🚀 Quick Checklist
# Find executable command -v appname which appname type -a appname # Check Homebrew brew list | grep appname brew info appname # Check npm npm list -g --depth=0 | grep appname # Uninstall brew uninstall appname brew uninstall --cask appname npm uninstall -g appname # Clear cache hash -r # Search leftovers find ~/.appname /opt/homebrew -iname "*appname*" 2>/dev/null # Remove leftovers rm -rf ~/.appname rm -rf /opt/homebrew/.appname # Final check command -v appname type -a appname
Last updated: June 2026
```








