Sweepfor Mac

Mac maintenance

How to Show Hidden Files on Mac (And Why You'd Want To)

Mac hidden files include dotfiles, system folders, and metadata. Here's how to show them temporarily or permanently — and when to leave them alone.

7 min read

There’s a whole second layer of files on every Mac that you can’t see by default. Configuration files starting with a dot, the user Library folder, system caches, hidden tools — all there, all useful, all invisible to a normal Finder window.

Most of the time, that’s the right setting. Apple hides them because messing with them can break things. But every Mac user eventually needs to peek behind the curtain. Here’s how to do it without trashing your system.

The keyboard shortcut

The fastest way to show hidden files in Finder:

  • Press Cmd+Shift+. (period)

Hidden files appear, slightly transparent so you can tell them apart from regular files. Press the same combo again to hide them.

This works in any Finder window and in most Save/Open dialogs throughout macOS. It’s the right tool for “I just need to grab one hidden file and then go back to normal.”

The setting doesn’t persist across Finder relaunches in some macOS versions — toggle it as needed.

Show the user Library folder

The user Library folder (~/Library) is hidden by default but accessible without showing all hidden files.

To open it temporarily:

  1. In Finder, click the Go menu in the menu bar
  2. Hold Option — “Library” appears in the menu
  3. Click Library

This opens ~/Library without revealing every other hidden file.

To make Library permanently visible in your home folder:

  1. Open your home folder (Cmd+Shift+H)
  2. Press Cmd+J (Show View Options)
  3. Check “Show Library Folder”

Now Library shows up in your home folder list permanently, while other hidden items stay hidden.

Tip: The user Library folder is full of app caches, preferences, and saved state. Resist the urge to clean it manually — most files there exist for a reason. The exception is a folder you can confirm belongs to an uninstalled app.

Show all hidden files permanently

If you work with hidden files often (developers, sysadmins, anyone editing dotfiles), you might want them visible always.

Open Terminal and run:

defaults write com.apple.finder AppleShowAllFiles -bool true
killall Finder

Hidden files now show in every Finder window, all the time. To revert:

defaults write com.apple.finder AppleShowAllFiles -bool false
killall Finder

The same Cmd+Shift+. toggle still works after this — it just toggles around your new default.

For most casual Mac users, leaving the default (hidden) and using Cmd+Shift+. when needed is the right call. Constant visibility of dotfiles makes Finder windows noisier than helpful for non-technical work.

What the hidden files actually are

The categories you’ll encounter:

  • Dotfiles in your home folder: .bashrc, .zshrc, .gitconfig, .ssh/, .config/ — config files for shell, version control, and various developer tools
  • .DS_Store files: macOS-specific files in every folder you’ve ever visited in Finder. Stores Finder view preferences for that folder. Harmless and regenerated automatically.
  • System folders: /private, /usr, /var, /bin, /sbin, /etc — the Unix underlayer of macOS
  • /Library: the system-wide Library folder, mostly readable but mostly off-limits to modify
  • /Volumes: mount points for external drives and disk images
  • .Trashes, .Trash, .fseventsd: macOS internal bookkeeping folders

For most users, only the first two categories matter day-to-day.

Use Terminal to see and edit hidden files

Terminal sees everything by default. To list all files in a folder including hidden:

ls -la

The -a flag shows hidden files. The -l gives the long format with permissions and dates.

To see just dotfiles in your home folder:

ls -d ~/.[!.]*

Reading or editing a hidden file is straightforward — just use the full path:

open ~/.zshrc

This opens your zsh shell config in the default text editor. Or use a Terminal editor:

nano ~/.zshrc

When in doubt about a hidden file, leave it alone. Most have specific purposes and editing them at random can break tools that depend on them.

Use the “Go to Folder” trick

Hidden folders by path: in Finder, press Cmd+Shift+G and type the path. Examples:

  • ~/Library — user Library
  • /Library — system Library
  • ~/Library/Caches — your app caches
  • ~/Library/Application Support — most app data
  • /usr/local/bin — Unix command-line tools (often Homebrew installs)
  • /private/var/log — system logs

Press Return and Finder opens that folder, even if it’s normally hidden. This is the surgical approach: you don’t show all hidden files, you just navigate directly to one specific hidden location.

Less clutter, faster MacSweep clears the caches and logs slowing down everyday actions. Try Sweep free →

Common reasons to show hidden files

The legitimate reasons people need this:

  1. Editing shell config: ~/.zshrc, ~/.bashrc, ~/.gitconfig for developers
  2. Manual app cache cleanup: finding ~/Library/Caches/[app-name] for a specific misbehaving app
  3. Recovering from a broken app: removing a corrupted preference file from ~/Library/Preferences/
  4. Moving config between Macs: copying dotfiles to a new machine
  5. Investigating malware: suspicious LaunchAgents in ~/Library/LaunchAgents/

For each, you don’t need to show all hidden files globally. Cmd+Shift+G to jump to the specific path is cleaner.

What NOT to do with hidden files

A few cautionary notes:

  • Don’t delete .DS_Store files manually. They regenerate. Tools like dot_clean or find . -name ".DS_Store" -delete can remove them in bulk if you really need to (mostly for cleaning up before zipping or sending to non-Mac users).
  • Don’t move folders from /private or /usr. These are core macOS directories. Modifying them can break the system.
  • Don’t change permissions on system folders. Specifically, don’t run sudo chmod or chown on system paths unless you know exactly what you’re doing.
  • Don’t trust random “speed up your Mac” guides that say to delete the Caches folder. Some app caches are needed for fast startup; deleting them all can slow your Mac temporarily.

For app cache cleanup that’s actually safe, dedicated tools handle the “what’s safe to delete” decision for you.

Tagging hidden files

Hidden files can be tagged like any other file. Show them, right-click, add a Finder tag. The tag persists in metadata even when the file is hidden again.

Useful for marking specific dotfiles you want to find quickly later (.zshrc tagged “Active” so you can find it via the tag sidebar).

Hidden files in Time Machine

Time Machine backs up hidden files by default — your dotfiles, Library contents, and so on are all preserved. If you accidentally delete a critical hidden file, Time Machine can restore it.

To restore: open Time Machine, navigate to the folder where the file used to live (you might need to enable “show hidden files” first to see it), scrub backward to before the deletion, and restore.

Toggle as needed, don’t live with hidden files visible

For 95% of Mac use, hidden files should stay hidden. They make Finder windows messier without improving your day-to-day workflow.

The right pattern:

  • Default: hidden
  • When you need them: Cmd+Shift+. to toggle, or Cmd+Shift+G to navigate directly
  • After you’re done: Cmd+Shift+. to hide again

The defaults write permanent option is for users who really do interact with hidden files daily. For most people, it’s overkill.

The hidden file system on macOS isn’t sneaky — it’s protective. Most of the things hidden are hidden because they shouldn’t be casually modified. When you do need to see them, the toggle takes one second. Use that toggle and trust the default.

← Back to all guides