MainspringGuides › Show Config Files
macOS Guide

Show hidden files like .env and .htaccess for web work

Updated July 2026 · 3 min read

Open a web project in Finder and half the files that matter aren't there. .env, .htaccess, .gitignore, .npmrc — every config file that begins with a dot is hidden by macOS. When you need to copy a .env, drag an .htaccess to a server, or check what your .gitignore actually contains, flip hidden files on: Cmd+Shift+. for one folder, or a permanent setting for your whole workflow.

Show them per window while you work

The quickest move, and the one most web devs use, is the toggle. It's scoped to Finder generally but you'll trigger it right where you need it.

This is ideal when you dip into Finder occasionally but mostly live in an editor. Nothing to remember, nothing to reset.

Make config files visible for good

If you're in and out of project folders in Finder all day — staging deploys, comparing environments — set hidden files to always show. One command does it:

# Show .env, .htaccess and all other dotfiles in Finder
defaults write com.apple.finder AppleShowAllFiles -bool true
killall Finder

The killall Finder line relaunches Finder so it takes effect immediately. To go back to hiding them:

# Hide config files again
defaults write com.apple.finder AppleShowAllFiles -bool false
killall Finder

Both the shortcut and the command behave the same on macOS 13 Ventura, 14 Sonoma, and 15 Sequoia.

Two things worth knowing for web projects

One caution when deploying by dragging in Finder: with hidden files visible it's easy to also grab .git or .env and push secrets to a live server. Select deliberately, and never drag a whole project folder to a public web root with hidden files included.

A toggle built for config files

Mainspring makes "show hidden files" a labelled switch — flip it on to work with .env and .htaccess in Finder, flip it off after. It's one of 90+ hidden macOS settings it turns into reversible toggles.

Try Mainspring free →

Signed & notarized by Apple · 1-day free trial · $29 once

While you're editing configs

Local web work often means pointing a domain at your own machine. Our guide to editing the hosts file on Mac pairs naturally with this — another hidden config file you'll want to reach without fighting Finder.