How to Find Files You Do Not Have Permission to Access on a Mac

Illustration for How to Find Files You Do Not Have Permission to Access on a Mac

Quick Answer Use Finder’s Get Info window to check a file’s permissions, or use Terminal to search for files you cannot read. In Terminal, the following command searches your home folder and reports files that cannot be opened by your account: find "$HOME" -type f ! -readable -print This command only searches and reports files; … Read more

How to Fix File Ownership and Permissions Safely Using Terminal on a Mac

Illustration for How to Fix File Ownership and Permissions Safely Using Terminal on a Mac

Quick Answer To fix a file or folder you own, first inspect it with ls -leO@. Then use chown to change ownership and chmod to change permissions. Start with the smallest possible change, work on a specific path instead of an entire disk, and verify the result afterward. Never run a recursive ownership or permission … Read more

How to Check Power and Battery Information Using pmset on a Mac

Illustration for How to Check Power and Battery Information Using pmset on a Mac

Quick Answer To view your Mac’s current power and battery settings, open Terminal and run: pmset -g For battery-specific details, run: pmset -g batt For a broader report that includes power settings, battery status, and sleep-related information, use: pmset -g custom These commands only display information. They do not change your Mac’s settings or delete … Read more

How to Find What Is Preventing Your Mac from Sleeping Using Terminal

Illustration for How to Find What Is Preventing Your Mac from Sleeping Using Terminal

Quick Answer Open Terminal and run: pmset -g assertions Look for active assertions, especially entries showing PreventUserIdleSystemSleep or PreventSystemSleep. The process name, application name, or assertion owner listed beside an active entry can identify what is keeping your Mac awake. To see recent sleep and wake activity, run: pmset -g log | grep -iE ‘sleep|wake|darkwake|maintenance’ … Read more

How to Check Why a Mac Restarted or Shut Down Using Terminal

Illustration for How to Check Why a Mac Restarted or Shut Down Using Terminal

If your Mac restarted or shut down unexpectedly, Terminal can help you determine whether macOS recorded a power loss, forced restart, kernel panic, scheduled shutdown, or a normal shutdown. The most useful starting point is the last command, followed by unified-log searches for events around the time the problem occurred. Quick Answer Open Terminal from … Read more

How to Search macOS Logs for Errors Using the log Command

Illustration for How to Search macOS Logs for Errors Using the log Command

Quick Answer Use the log command in Terminal to search macOS’s unified log for messages that match an error, process, subsystem, or time range. For example: log show –last 1h –predicate ‘eventMessage CONTAINS[c] "error"’ –info This displays log entries from the last hour whose message contains “error,” without changing system settings or deleting logs. Replace … Read more

How to View Recent macOS System Logs Using Terminal

Illustration for How to View Recent macOS System Logs Using Terminal

Quick Answer To view recent macOS system logs, open Terminal and run: log show –last 1h This displays log entries from the last hour. You can narrow the results by process, subsystem, severity, or time period. To watch new entries as they appear, use: log stream The macOS log command reads the unified logging system, … Read more