Blog

How to show hidden files on a Mac

Press Shift-Command-Period in Finder to show hidden files on a Mac, and again to hide them. What those files are, which ones are safe to touch, and the Library folder.

In any Finder window, press ⇧⌘. (Shift-Command-Period). Hidden files and folders appear, slightly dimmed. Press the same keys again to hide them. The shortcut also works in every Open and Save dialog.

Show them permanently

In Terminal:

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

Replace true with false to go back. Most people are better off with the shortcut: seeing every hidden file all the time makes folders noisy.

What those hidden files are

Name What it is Safe to delete?
.DS_Store Finder’s view settings for that folder yes, Finder recreates it
.localized tells macOS to show the folder name in your language leave it
._filename Mac file details, on drives formatted for Windows yes, on a USB stick shared with a PC
.Trashes, .Spotlight-V100, .fseventsd Trash, search index and file events of a drive no
.git, .env, .zshrc developer and shell settings only if you know what they do

A dot at the start of the name is what makes a file hidden on macOS. Folders like ~/Library are hidden with a flag instead, and don’t need a dot.

Open the Library folder

Hold ⌥ (Option) and click the Go menu in Finder: Library appears in the list. Or press ⇧⌘G and type ~/Library. It holds app settings, caches and support files. Deleting inside it can reset or break apps: move files to the Trash, don’t empty it until you’ve checked the app still works.

Hide a file yourself

In Terminal, chflags hidden ~/Desktop/private hides a file or folder; chflags nohidden shows it again. Renaming a file to start with a dot also hides it, but Finder refuses that name; Terminal’s mv does it.

Hidden files and sorting

Hidden system files belong where they are: a tool that sorts folders should leave them alone.

Sort the files you can see

DeclutrDeclutr sorts Downloads, the Desktop or any folder into category folders by file type: Documents, Images, Videos, Audio, Archives, Apps, Code & Scripts, 3D Models and more. It leaves hidden system files where they are and stops to ask before a folder that looks sensitive. One Undo button puts every file back. The sort is free; Pro, a one-time $8.99 purchase in the US, adds watched folders, scheduled cleanups and rules. It needs macOS 13 Ventura or later.

Related: how to organize files on a Mac and how to free up disk space on a Mac.

Questions people ask

How do I show hidden files on a Mac?

In a Finder window, press Shift-Command-Period (⇧⌘.). Hidden files and folders appear dimmed. Press the same keys again to hide them. It also works in Open and Save dialogs.

How do I show hidden files permanently on a Mac?

In Terminal, run defaults write com.apple.finder AppleShowAllFiles -bool true, then killall Finder. To undo it, run the same command with false.

What is the .DS_Store file on a Mac?

A hidden file Finder creates in each folder to remember its view settings: icon positions, sort order, window size. It is harmless and safe to delete; Finder makes a new one when needed.

How do I open the Library folder on a Mac?

In Finder, click the Go menu while holding Option: Library appears in the list. Or press Shift-Command-G and type ~/Library.