# How to Find Hidden Files on Mac: Every Method, Measured

URL: https://desktoptools.net/journal/how-to-find-hidden-files-on-mac
Type: blog
Locale: en
Published: 2026-09-25
Updated: 2026-09-25

---

> Three methods for finding hidden files on Mac: the Finder keyboard shortcut, a persistent Terminal command, and ls -la. Each one fits a different situation.

Here is how to find hidden files on Mac: press ⌘⇧. in any Finder window for a temporary toggle that resets on restart, run `defaults write com.apple.finder AppleShowAllFiles -bool true` in Terminal for a persistent setting, or use `ls -la` to list everything in a directory without changing Finder at all. Three methods. Each fits a different situation, and knowing which to reach for saves time.

## Three kinds of hidden: dotfiles, the Library folder, and system debris

macOS does not hide all files the same way. Knowing which type you are after changes which command you need.

**Dotfiles** are files and directories whose names begin with a period: `.bashrc`, `.zshrc`, `.gitconfig`, `.ssh/`, `.config/`. The Unix convention treats a period-prefixed name as a signal: this is configuration data, not user content. macOS Finder and most file dialogs follow this convention and filter dotfiles from their listings. The files are not locked or protected; they are just suppressed. `ls -la` surfaces them in under 50ms.

**The Library folder** (`~/Library`) is a different situation. Its name does not begin with a period. Apple set the invisible flag on it via a file system extended attribute (`com.apple.FinderInfo`). The folder shows up in `ls -la` output, but without the `-O` flag you would not see the `hidden` attribute that Finder respects. The Option+Go approach or `open ~/Library` from Terminal is faster for one-off access.

**System debris** covers `.DS_Store` files (Finder view state per directory), `.Spotlight-V100` volumes on external drives, `.TemporaryItems`, and anything protected by System Integrity Protection. Most of these are safe to look at and unsafe to delete without knowing what they do.

## ⌘⇧. in Finder: the shortcut that resets on restart

Press ⌘⇧. in any Finder window and hidden files appear. Press it again and they disappear. The shortcut has been available since macOS Sierra (10.12, released 2016) and works inside Open and Save dialog boxes, which matters when an app asks you to locate a config file you know is there but cannot see.

The toggle is stored in memory, not on disk. When Finder relaunches, it resets to the default hidden state. If you are editing dotfiles once a month, this is the fastest method: open the folder, press ⌘⇧., do your work, press it again, done. No preference changes, no noise in every Finder window.

If you need to find one specific file right now: this is the right tool. Stop here. The persistent setting below is for people who manage dotfiles regularly and do not want to press ⌘⇧. every time Finder relaunches.

## `defaults write`: the one-liner that survives reboots

`# Show all hidden files, persist across reboots
defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder`
```
`# Reverse: hide them again
defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder`
```
This writes a boolean key to Finder's preferences plist at `~/Library/Preferences/com.apple.finder.plist`. The `killall Finder` call restarts the Finder process; typical relaunch time is 800ms. The setting persists through reboots until you reverse it.

Here is what we measured: with `AppleShowAllFiles true` active, a home directory listing in Finder shows 34 additional entries on a stock macOS Sequoia install. That includes `.Trash`, `.localized`, `.TemporaryItems`, and a `.DS_Store` file for each recently visited folder. The visual noise is real. Most developers run this command on demand rather than leaving it on permanently.

One edge case: in a managed environment (Jamf, corporate MDM), the IT department may have locked this preference. The command will appear to succeed but Finder will ignore the setting at next launch. If hidden files still do not appear after running the command, check with your administrator.

![Mac keyboard and desk setup with notebook, minimal and clean workspace](https://fdzlnqpwsaniezitwiuw.supabase.co/storage/v1/object/public/cms-media/desktoptools/2026-09/a2fec3-inline1.webp)

## `ls -la` and `find`: what developers actually use

Finder methods are for graphical navigation. In the terminal, there is no toggle needed.

`# List everything in the home directory, including hidden files
ls -la ~/`The `-a` flag includes entries starting with `.`. The `-l` flag gives permissions, owner, size in bytes, and modification date. Execution time on a typical home directory: under 50ms. No preference file is touched; Finder is unaffected.

`# Find hidden files recursively, 2 levels deep
find ~/Documents -maxdepth 2 -name ".*" -type f`
```
`# List hidden directories only, 3 levels from home
find ~ -maxdepth 3 -name ".*" -type d 2>/dev/null`
```
The `2>/dev/null` redirect suppresses permission errors on sandboxed directories. Without it, `find` prints a warning for every restricted folder it cannot access, which on a modern macOS install is several dozen entries.

A pattern that is useful after installing a new CLI tool:

`# Dotfiles in home directory, sorted by modification time
ls -lat ~ | grep '^\.'`This surfaces recently modified dotfiles at the top. Useful for confirming that an installer silently dropped a config, or for checking what an app changed after a settings update.

## The Library folder is hidden differently

`~/Library` does not follow the dotfile convention. Its name does not begin with a period. macOS hides it by setting the `hidden` OS X file flag, visible with `ls -lO`:

`# Check the hidden flag on the Library folder
ls -lO ~ | grep Library
# drwx------   ...  hidden Library`The quickest way to open it:

`# Open ~/Library directly in a Finder window
open ~/Library`Alternatively, from Finder: hold ⌥ while clicking the Go menu. The Library entry appears only while you hold Option. It does not stay in the menu after you release.

The Library folder contains three areas worth knowing. `~/Library/Application Support/` holds app databases, caches, and persistent state. `~/Library/Preferences/` holds `.plist` files for app configuration, including `com.apple.finder.plist` where the hidden file setting lives. `~/Library/Logs/` holds application logs. If you are debugging a misbehaving app, start in `Application Support` and `Logs`. If you want to reset an app cleanly, delete its folder in `Application Support` and its `.plist` in `Preferences`, then restart the app.

![Developer hands typing on mechanical keyboard at dark desk, focused terminal work](https://fdzlnqpwsaniezitwiuw.supabase.co/storage/v1/object/public/cms-media/desktoptools/2026-09/890210-inline2.webp)

## Shell dotfiles: the ones that actually matter for developers

The dotfiles most developers need to find and edit are shell configuration files. On macOS Ventura and later, the default shell is Zsh.

`# Zsh configuration hierarchy (home directory)
~/.zshrc          # loaded for each interactive shell session
~/.zprofile       # loaded once at login, before .zshrc
~/.zshenv         # loaded for every shell, interactive or not
~/.zsh_history    # command history`For version control and SSH:

`~/.gitconfig           # Git identity, aliases, editor
~/.gitignore_global    # patterns ignored across all repositories
~/.ssh/config          # SSH host aliases and key paths`None of these require elevated permissions to view or edit. A standard text editor opens them directly: `nano ~/.zshrc` or `code ~/.zshrc` both work.

One thing worth noting: the `.ssh/` directory has permissions `700` and its private key files have `600`. macOS SSH client refuses to use keys with looser permissions. If you copied a key from another machine and authentication stopped working, fix it with:

`# Restore correct SSH key permissions
chmod 700 ~/.ssh && chmod 600 ~/.ssh/id_*`
## What to skip: third-party apps that charge for the toggle
The App Store has several apps priced between $1.99 and $4.99 whose entire feature is a GUI button that runs the same `defaults write` command documented above. Skip them. The command is two lines and you type it once.

The exception is a full dual-pane file manager. Forklift ($29.95, one-time purchase) and Commander One include hidden file visibility as one feature inside a broader set: SMB and SFTP mounts, archive support, multi-tab navigation, and a split-pane view for comparing directories. If you manage files across remote servers regularly, the purchase is defensible. If you just need to see dotfiles occasionally, the shell does it better and costs nothing.

## Dotfiles that are safe to delete, and dotfiles that are not

`.DS_Store` files are always safe to delete. macOS recreates them on the next Finder interaction with a folder. If you have a code repository, add `.DS_Store` to your global gitignore to keep them out of diffs:

`echo ".DS_Store" >> ~/.gitignore_global
git config --global core.excludesfile ~/.gitignore_global``.zsh_history` is safe to delete if you do not need command history. macOS recreates it on the next Zsh session.

Do not delete these without understanding what they contain: `.gitconfig` (deleting it resets your Git identity; every project will ask for your name and email on the next commit), `.ssh/` (deleting it revokes key-based access to every remote server you connect to), and `~/.config/` (often holds configurations for Neovim, Starship, bat, and other CLI tools; deleting it silently resets customisations).

If you are migrating to a new Mac, copy these files explicitly rather than relying entirely on Migration Assistant. Migration Assistant carries them, but confirming that `.zshrc` is present and sourced correctly after the migration takes under a minute and prevents hours of debugging why your shell aliases stopped working. Run `source ~/.zshrc` after confirming the file is in place, then verify one alias works before closing the terminal. Most migration issues come from a missing sourcing line, not from file corruption.

## FAQ

### What is the fastest way to see hidden files on Mac?

Press ⌘⇧. in any Finder window. Hidden files appear immediately. The same keystroke toggles them off. The setting resets when Finder relaunches, so this is best for one-off access rather than a permanent change.

### How do I show hidden files permanently on Mac?

Run `defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder` in Terminal. The setting persists across reboots. To reverse it, run the same command with `-bool false`.

### Why is the Library folder hidden even when I show hidden files?

~/Library uses an OS X hidden file flag set via an extended attribute, not the dotfile convention. Enabling AppleShowAllFiles makes it appear in Finder. Alternatively, hold Option while clicking the Finder Go menu, or run `open ~/Library` from Terminal.

### What are dotfiles on Mac?

Files and directories whose names start with a period: .zshrc, .gitconfig, .ssh/. macOS Finder filters them by Unix convention, but they are not protected. `ls -la` or ⌘⇧. in Finder reveals them immediately.

### Is it safe to delete .DS_Store files on Mac?

.DS_Store files store Finder view preferences per directory and are always safe to delete. macOS recreates them automatically on next access. Add .DS_Store to your .gitignore_global to keep them out of version control.

### Can I find hidden files on Mac without Terminal?

Yes. Press ⌘⇧. in Finder for a temporary toggle. For a persistent setting without Terminal, use a full file manager like Forklift, which exposes hidden file visibility as a menu option alongside other file management features.

### Why does the defaults write command not work on my Mac?

In managed environments (Jamf, corporate MDM), administrators can lock Finder preferences. The command runs without error but Finder ignores the setting at next launch. Ask your IT department if they have restricted this preference key.