Free Interactive Mac Tool

Mac Terminal Command Generator

Generate safe, tested macOS Terminal commands with interactive options. Copy commands with a single click without typing errors.

Show or Hide Hidden Files in Finder

Safe Preference

Toggle visibility of hidden system files and dotfiles (such as .gitignore or .zshrc) directly in macOS Finder.

Terminal
defaults write com.apple.Finder AppleShowAllFiles -bool YES && killall Finder
Tip: You can also press Cmd + Shift + . (period) in any Finder window for a quick keyboard toggle.

Flush DNS Cache

Admin Password Required

Clears your local Domain Name System cache. Fixes issues where websites will not load after DNS or IP address changes.

Terminal
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Note: Requires administrator privileges. Terminal will prompt for your Mac login password (typing will be invisible).

Purge Inactive RAM Memory

Admin Password Required

Forces macOS to flush inactive memory disk caches. Useful when testing memory-intensive applications without rebooting.

Terminal
sudo purge
Note: macOS manages memory automatically. Running purge is best reserved for immediate memory pressure or developer testing.

Rebuild Spotlight Search Index

Admin Password Required

Erases and rebuilds the Spotlight search index across your primary drive. Fixes issues when Spotlight cannot find files or apps.

Terminal
sudo mdutil -E /
Note: After running, Spotlight may take 15 to 45 minutes to finish re-indexing your entire drive in the background.

Prevent Mac From Sleeping (Caffeinate)

100% Safe

Keeps your Mac awake while long downloads, file transfers, or video renders finish, without changing System Settings.

Terminal
caffeinate -d
Tip: Press Control + C in Terminal whenever you want to end caffeinate and let your Mac sleep normally.

Restart Finder

Safe Preference

Gracefully terminates and immediately relaunches the Finder process. Solves frozen desktop windows and missing file icons.

Terminal
killall Finder
Note: Open Finder windows will close momentarily and reappear automatically within two seconds.

Restart Dock

Safe Preference

Relaunches the macOS Dock. Fixes frozen application icons, stuck notification badges, or mission control display bugs.

Terminal
killall Dock

Remove All .DS_Store Files in User Directory

Safe Cleanup

Finds and removes hidden .DS_Store files across your user directory. Useful before archiving or uploading folders to external servers.

Terminal
find ~ -name ".DS_Store" -depth -exec rm {} \;

Show Full File Path in Finder Window Title

Safe Preference

Displays the complete folder directory path in the title bar of every Finder window instead of just the current folder name.

Terminal
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES && killall Finder

Check MacBook Battery Cycle Count

100% Safe (Read-Only)

Reads the exact battery health cycle count and charge status directly from the macOS system hardware profiler.

Terminal
ioreg -r -c "AppleSmartBattery" | grep -i "CycleCount"

Find Files Larger Than 1GB in Home Folder

100% Safe (Read-Only)

Scans your user directory and outputs a list of all files exceeding 1 gigabyte in size, sorted by size.

Terminal
find ~ -type f -size +1G -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'

Reset QuickLook Thumbnail Cache

Safe Cleanup

Clears corrupted QuickLook thumbnail databases. Fixes blank icons or wrong previews when pressing Spacebar on files.

Terminal
qlmanage -r cache && qlmanage -r
DiskCompanion App Icon
Safe Mac Maintenance

Afraid of making a mistake in Terminal?

Terminal is powerful, but one mistyped character in a cleanup command can accidentally erase important user documents or trigger scary error codes. Managing system caches, old logs, and orphaned files by hand takes time and technical confidence.

DiskCompanion provides a safe, visual alternative. With zero Terminal commands required, its interactive Space Lens visualizer maps your drive storage, while Smart Clean sweeps away gigabytes of stale app caches and system leftovers with a single click.

🛡️
100% Safe 1-Click Actions Zero cryptic command flags or dangerous syntax errors to worry about.
🔍
Space Lens Visualizer Spot hidden gigabyte-heavy folders visually instead of using command lines.
Zero Background Daemons Operates only when you open it. Zero background battery drain or system clutter.

One-time purchase of $29. No recurring subscriptions. Full 14-Day Money-Back Guarantee.

How to Safely Open and Use Terminal on Mac

Terminal is the default command-line interface included on every Mac. It allows you to communicate directly with the underlying Unix foundation of macOS. While the interface looks simple, follow these best practices to ensure safe operation:

  1. Open Terminal: Press Cmd + Space, type Terminal, and press Return.
  2. Paste Carefully: Copy the exact command from this tool and press Cmd + V to paste it into Terminal. Avoid typing commands manually to eliminate typo risks.
  3. Execute: Press Return on your keyboard to run the command.
  4. Check the Prompt: When the command completes, Terminal prints a new line ending in your username or a dollar sign ($), indicating it is ready for the next task.

What Is Sudo and Why Does Terminal Ask for Your Password?

Commands that begin with sudo (SuperUser DO) require administrator privileges to modify system-level settings or flush protected caches.

When you press Return after entering a sudo command, Terminal prompts you with: Password: 🔑. For security reasons, macOS intentionally does not show any characters, asterisks, or cursor movement while you type your password. Type your login password normally and press Return.

Terminal Commands vs Native Disk Utilities: Which Is Safer?

Terminal commands are effective for one-off tweaks, such as toggling hidden files or flushing DNS caches. However, using command-line commands for routine disk cleaning and space recovery carries real risks:

  • No Confirmation Dialogs: Unix commands execute immediately upon pressing Return without a safety net or Trash folder backup.
  • No Visual Context: Running find or du commands produces raw text lists that are hard to interpret compared to an interactive visualizer.
  • Time Consuming: Checking dozen of individual app cache paths by hand requires remembering multiple complex directories.

For ongoing Mac maintenance and disk space recovery, dedicated utilities like DiskCompanion provide a safer, faster experience by giving you complete visual control before removing any files.

Essential Terminal Shortcuts Every Mac User Should Know

Shortcut Action When to Use It
Control + C Abort Current Command Immediately stops a running script, search, or caffeinate command.
Control + L Clear Terminal Screen Clears all previous text and gives you a fresh, clean window.
Up Arrow Previous Command Recalls the last command you executed without re-typing.
Tab Auto-Complete Type the first few letters of a file or folder and press Tab to auto-complete.

Frequently Asked Questions

How do I open Terminal on my Mac?

The fastest way to open Terminal is using Spotlight. Press Command and Spacebar together on your keyboard, type Terminal, and press Return. You can also find Terminal in Finder by opening Applications, then opening the Utilities folder.

Why does Terminal not show my password when I type sudo commands?

This is standard Unix security behavior. When you enter a command that starts with sudo, Terminal asks for your Mac administrator password. As you type your password, no characters, asterisks, or dots appear on the screen. Simply type your password normally and press Return.

Can running a wrong Terminal command damage my Mac?

Most basic commands that read system information or change user preferences are completely safe. However, commands that modify system files, format disks, or use administrative permissions (sudo) can cause irreversible data loss if mistyped. If you are uncomfortable using Terminal, dedicated Mac utilities like DiskCompanion provide a safe graphical interface with zero command-line risks.

How do I stop or cancel a running command in Terminal?

If a command is taking too long or you want to abort it immediately, press Control and C together on your keyboard. This sends an interrupt signal to the process and returns you to a fresh command prompt without making further changes.

What is the difference between Terminal commands and DiskCompanion?

Terminal commands require you to manually find, type, and verify commands every time you want to clear a cache or inspect storage. DiskCompanion provides an automated, visual interface that scans your entire SSD, identifies hidden gigabytes of junk, and safely removes them with a single click, completely eliminating command-line errors.