MacOS TROUBLESHOOTING & REPAIR COMMANDS 🍎🛠️
Having issues with your Mac? These essential Terminal commands help you diagnose system problems, repair disks, fix network issues, check battery health, and resolve app crashes like a pro. Perfect for MacBook users, IT students, and technicians.
🧪 SYSTEM DIAGNOSTICS
Copy code
Bash
system_profiler SPSoftwareDataType
log show --predicate 'eventMessage contains "error"' --last 1h
🧹 DISK & FILE SYSTEM REPAIR
Copy code
Bash
diskutil verifyDisk disk0
diskutil repairDisk disk0
diskutil verifyVolume /
diskutil repairVolume /
🔹 (Use Recovery Mode ⌘ + R if disk is in use)
🧠 MEMORY & CPU TROUBLESHOOTING
Copy code
Bash
top
vm_stat
ps aux | sort -nrk 3 | head # High CPU usage
🌐 NETWORK TROUBLESHOOTING
Copy code
Bash
ping -c 5 google.com
networksetup -listallhardwareports
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
🔋 BATTERY HEALTH CHECK
Copy code
Bash
pmset -g batt
system_profiler SPPowerDataType
🔄 RESET SERVICES (Common Fixes)
Copy code
Bash
sudo killall Finder
sudo killall Dock
sudo killall SystemUIServer
🧯 SAFE MODE & RECOVERY
Copy code
Bash
nvram -p # Check NVRAM
csrutil status # SIP status (Recovery Mode)
🧰 APP CRASH INVESTIGATION
Copy code
Bash
ls ~/Library/Logs/DiagnosticReports
open ~/Library/Logs/DiagnosticReports
⚠️ Important Notes
Use sudo carefully
Backup before disk repairs
Some commands require Recovery Mode
Save this and keep it handy for quick macOS fixes! 💻✨
Follow ANIK Digital and Information Technology for more practical tech tips and guides.
#macOS #TerminalCommands
#MacTroubleshooting