How to Find Files by Name, Type, or Size Using find on a Mac

Illustration for How to Find Files by Name, Type, or Size Using find on a Mac

Quick Answer The find command searches folders recursively, meaning it checks a folder and the folders inside it. Open Terminal, then use a command such as: find ~/Documents -type f -name "report.pdf" This searches your Documents folder for a file named report.pdf. You can also search by file type or size: find ~/Downloads -type f … Read more

How to Search Inside Files with grep on a Mac

Illustration for mac-guides/storage-management

Quick Answer To manage storage on your Mac, open System Settings > General > Storage. Review the largest categories, remove files you no longer need, empty the Trash, and uninstall apps you do not use. Keep enough free space for macOS and your everyday work rather than deleting system files at random. For a more … Read more

How to Find Recently Modified Files Using Terminal on a Mac

Illustration for How to Find Recently Modified Files Using Terminal on a Mac

Quick Answer Open Terminal and use the find command with a time filter. For example, this command searches your home folder for regular files modified within the last 24 hours: find "$HOME" -type f -mtime -1 -print -type f limits the results to files, -mtime -1 selects files modified less than one 24-hour period ago, … Read more

How to Compare Two Files or Folders Using Terminal on a Mac

Illustration for How to Compare Two Files or Folders Using Terminal on a Mac

Quick Answer To compare two text files in Terminal, use diff: diff -u "/path/to/file-one.txt" "/path/to/file-two.txt" To compare two folders and their contents, use: diff -rq "/path/to/folder-one" "/path/to/folder-two" The -u option shows readable line-by-line differences. The -r option checks subfolders recursively, and -q reports only whether files differ. These commands compare data without changing either file … Read more

How to Verify a Downloaded File’s SHA-256 Checksum on a Mac

Illustration for How to Verify a Downloaded File’s SHA-256 Checksum on a Mac

Quick Answer To verify a downloaded file’s SHA-256 checksum on a Mac: Find the checksum published by the software developer or download provider. Open Terminal. Run shasum -a 256 followed by the file’s path. Compare the 64-character result with the published checksum. If the two values match exactly, the file’s contents match the file used … Read more

How to Check Gatekeeper Status and App Signatures Using Terminal on a Mac

Illustration for How to Check Gatekeeper Status and App Signatures Using Terminal on a Mac

Gatekeeper helps macOS verify that downloaded apps come from identified developers and have not been altered. You can check Gatekeeper’s current status with spctl –status, inspect an app’s signature and notarization with codesign, and test whether macOS accepts an app with spctl –assess. These commands are read-only: they do not enable or disable Gatekeeper, modify … Read more

How to View Mac App Crash Logs Using Terminal

Illustration for How to View Mac App Crash Logs Using Terminal

When a Mac app crashes, macOS records details about what happened in a crash report. You can view recent reports in Terminal with a few built-in commands, then use the information to identify the affected app, the crash time, the macOS process involved, and possible causes. The easiest method is to search the unified log … Read more

How to Check Extended Attributes on Mac Files Using Terminal

Illustration for How to Check Extended Attributes on Mac Files Using Terminal

Quick Answer To check a file’s extended attributes on a Mac, open Terminal, type xattr, add a space, drag the file or folder into the Terminal window, and press Return: xattr "/path/to/file" The command lists extended-attribute names attached to that item. To display the value of an attribute, use -p followed by the attribute name: … Read more