Articles

How to Show Hidden Files on a Mac (and Hide Them Again)

How to show hidden files on a Mac with Shift-Command-Period, open the Library folder, make it permanent in Terminal, and hide them all again afterwards.

Josh IbbotsonJosh Ibbotson
·October 25, 2026·6 min read
Four dark pixel-art cauldron skins beside the title How to show hidden files on a Mac

Quick answer: To show hidden files on a Mac, open a Finder window and press Shift-Command-Period (the full stop key). Hidden files and folders appear greyed out. Press the same shortcut again to hide them. The setting stays on until you toggle it off. Terminal can set the same preference, and a second command undoes it.

You went looking for a file a guide told you about. ~/Library, maybe, or a .zshrc, or the folder where the Bin keeps its contents. Finder insists it isn't there.

It is there. macOS hides a lot of files from normal Finder views, mostly for good reasons, and showing them takes one shortcut.

What is the shortcut to show hidden files on a Mac?

Shift-Command-Period, in any Finder window. Glenn Fleishman's Macworld guide describes it as a toggle: press it once and hidden items appear, greyed out so you can tell them apart; press it again and they vanish.

There is no menu item for this. It is a keyboard shortcut only, which is why so many people never find it.

The setting sticks until you press the shortcut again, so if hidden files suddenly start cluttering every folder, someone (possibly you, possibly a cat on the keyboard) pressed it.

What are the hidden files on a Mac?

Mostly things you're not meant to edit by hand. A few you'll meet:

  • .Trash, the folder in your home folder that holds your Bin. Our guide to what happens when you delete a file on a Mac explains why the Bin is just a hidden folder.
  • ~/Library, your user Library, where apps keep settings, caches and support files. Apple's Library note says plainly: "The Library folder is hidden."
  • .DS_Store files, which Finder writes into folders to remember things like view settings and icon positions, as Wikipedia's entry describes.
  • Dotfiles such as .zshrc and .ssh in your home folder, which hold settings for Terminal and command-line tools.
  • System folders such as bin and usr at the top of your startup disk, which belong to macOS.

Any file whose name starts with a full stop is hidden by default. ~/Library is the exception to the naming rule: it is hidden by a file flag instead, the same flag chflags sets below. It's a naming habit macOS inherited from Unix, and it doesn't protect anything.

How do you open the Library folder on a Mac?

Hold Option, then choose Go > Library in Finder. That is Apple's own method, and it works without showing every other hidden file. Click the desktop first so you're in Finder.

To keep it visible, open your home folder, press Command-J for View Options and tick Show Library Folder. You can also press Shift-Command-G for Go to Folder and type ~/Library. Our guide to uninstalling apps on a Mac uses that route to find the leftovers an app leaves behind.

How do you show hidden files on a Mac with Terminal?

Two commands set the same preference the shortcut does. Open Terminal and run these two commands, one after the other:

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

The first changes Finder's setting; the second restarts Finder so it takes effect. To hide them again, run the same pair with false in place of true.

If you only want to see hidden files in Terminal itself, ls -a lists everything in the current folder, dotfiles included, without changing Finder at all.

You don't need an app for this, or any command longer than those two lines.

Can you hide or unhide a single file?

Yes, with chflags. Macworld's guide covers it: chflags hidden followed by a space and the file's path hides that item, and chflags nohidden shows it again. Dragging the file into the Terminal window after typing the command fills in the path for you.

Is it safe to delete hidden files on a Mac?

Usually not, unless you know exactly what the file is. Hidden files are hidden because deleting them by accident breaks things. Removing a .DS_Store just resets that folder's view settings, but deleting something in ~/Library can wipe an app's data, and the system folders are protected anyway.

If you want to clear out an old app's leftovers, delete only folders you can match to that app by name. Leave everything else alone.

Should you paste Terminal commands from a website?

Only when you can read every word of them. The two commands above are short and do one visible thing. Be wary of any guide, "clean-up" page or fake CAPTCHA that asks you to paste a long command, especially one containing curl piped into zsh or bash, or a wall of scrambled text.

That pattern is how Mac malware spreads. Malwarebytes reported in April 2026 on a fake "Reclaim Disk Space on your Mac" page whose script used curl to fetch and run the Atomic Stealer infostealer. Jamf has described a similar Atomic Stealer campaign. Showing hidden files never needs a download.

Finding a hidden file, in order

  1. Press Shift-Command-Period in the Finder window where you expect the file to be.
  2. For your Library, hold Option and choose Go > Library instead of showing everything.
  3. Use Shift-Command-G if you know the path, such as ~/.Trash.
  4. Change only what you came for, then press Shift-Command-Period again to hide the rest.

Something nicer to look at than .Trash

Once you've seen the Bin is a hidden folder, it feels a bit plain. Spellbin is our own small paid Mac app: a pixel-art cauldron that sits in the Dock beside the Bin. Drop a file on it and a green flame carrying the file's thumbnail rises out and dissolves, and by default the file goes to the real Bin underneath.

Every drop counts towards achievements that unlock new cauldron skins. It won't find hidden files or clean your Library. It just makes deleting things more fun. Download Spellbin if your Dock could use one.

Hidden files on a Mac are hidden on purpose. Look as much as you like; delete carefully.

Frequently Asked Questions

How do I see hidden files in Finder on a Mac?

To see hidden files in Finder on a Mac, open any Finder window and press Shift-Command-Period. Hidden files and folders appear greyed out, so they are easy to tell apart. Press Shift-Command-Period again to hide them. There is no menu item for this; the keyboard shortcut is the built-in way.

Why can't I see the Library folder on my Mac?

The Mac Library folder in your home folder is hidden by default, according to Apple. To open it, click the desktop, hold the Option key and choose Go > Library in Finder. You can also press Shift-Command-G and type ~/Library, or press Shift-Command-Period in your home folder to show it.

How do I show hidden files on a Mac using Terminal?

To show hidden files on a Mac using Terminal, run "defaults write com.apple.finder AppleShowAllFiles -bool true", then "killall Finder" to restart Finder. Hidden files then stay visible in every window. To hide them again, run the same command with false instead of true, followed by killall Finder.

What is a .DS_Store file on a Mac?

A .DS_Store file is a hidden file that the Mac Finder creates inside folders to store their view settings, such as icon positions and sort order. It is harmless and safe to delete, though Finder recreates it the next time you open the folder and change its view.

How do I hide hidden files on a Mac again?

To hide hidden files on a Mac again, press Shift-Command-Period in a Finder window, the same shortcut that showed them. If you changed the setting in Terminal, run "defaults write com.apple.finder AppleShowAllFiles -bool false" and then "killall Finder". Hidden items disappear from every Finder window.

Final Takeaways

  • Shift-Command-Period shows and hides hidden files in any Finder window.
  • Option plus Go > Library opens your Library without revealing everything else.
  • Two Terminal lines make it permanent, and two more undo it.
  • Never paste a long or scrambled command from a page you don't trust.
Articles
Josh Ibbotson

Josh Ibbotson

Josh is an indie developer in the UK. He makes Spellbin, a pixel-art cauldron for your Dock, and Gym Note Plus.

Feed the cauldron

Spellbin is $1.99 once, for macOS 14 or later, with a 14-day money-back guarantee. Drop files on it, unlock skins, keep your Desktop tidy.

Get Spellbin for $1.99

Already bought Spellbin? Download it here

More from the blog

Your Bin, but with a cauldron

Spellbin turns deleting files into a small bit of magic.