Skip to main content

Want to switch from the Mole Mac site to the Windows site?

Go to the Windows site
Mole
MacWindows
Features Tested apps Testimonials Pricing FAQ Blog
EnglishEN 简体中文中 繁體中文繁 日本語日 한국어한 FrançaisFR DeutschDE ItalianoIT EspañolES PortuguêsPT NederlandsNL
Buy Download

    Help, documentation, releases, and articles.

    Blog

    How to Show Hidden Files on Mac

    StoragePublished November 9, 20265 min read

    To show hidden files on a Mac, open a Finder window and press Command + Shift + . (period). Hidden items appear dimmed, and the same keys hide them again. It works in Finder and in most Open and Save dialogs, and it changes only what you see, not the files. The rest of this page covers the permanent setting, Terminal, how to reach ~/Library, and which hidden items are safe to touch.

    Three ways to see them

    You want Do this Lasts
    A quick look in Finder Command + Shift + . Until you press it again
    Finder to always show them The defaults command below Until you delete the setting
    A list with names and flags ls -a or ls -lO in Terminal That one command

    The permanent setting needs Finder to restart, which closes and reopens its windows:

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

    To return to the default:

    defaults delete com.apple.finder AppleShowAllFiles
    killall Finder
    

    Most people are better off with the shortcut. With everything always visible, every folder fills up with .DS_Store and .localized, which makes it easier to drag or delete the wrong thing.

    Why a file is hidden

    macOS hides an item for one of two reasons. Its name starts with a period, like .zshrc, which is the old Unix convention. Or it carries the hidden flag, which is how ~/Library stays out of sight even though its name is ordinary. In Terminal, ls -a reveals both kinds and ls -lO prints the flag:

    ls -a ~
    ls -lO ~ | grep hidden
    

    You can set the flag yourself. This removes it from ~/Library, so the folder stays visible in your home folder:

    chflags nohidden ~/Library
    

    chflags hidden on a path puts it back out of sight. It hides the item from Finder only, so it is not privacy: ls -a and any app with access can still read it.

    Getting to ~/Library and other hidden folders

    You do not have to reveal everything to open one folder. In Finder, hold Option and open the Go menu, and Library appears in the list. For any other path, press Command + Shift + G to open Go to Folder and type it, for example ~/.config or /private/var/log. What is in the Library folder covers what each folder under ~/Library holds.

    What the hidden items are

    Item What it is Can it go
    .DS_Store Finder's view settings for that folder Yes, Finder writes a new one, and you lose that folder's icon positions and view
    .localized An empty marker that lets a folder show a translated name Leave it, it takes no space
    ~/.Trash The contents of your Trash Empty it through Finder
    .zshrc, .zprofile, .gitconfig Your shell and tool settings No, unless you know what is in them
    .ssh, .gnupg Private keys and known hosts No, losing a key can lock you out of servers
    ~/.npm, ~/.cache, ~/.cargo, ~/.gradle Developer tool caches and packages Often, through the tool's own clean command
    /private, /usr, /bin Parts of the operating system No

    A hidden folder that holds many gigabytes is usually one of the developer folders. To see the biggest items in your home folder, hidden ones included:

    du -hd 1 ~ 2>/dev/null | sort -h | tail -20
    

    macOS may ask whether Terminal can read Desktop, Documents or other protected folders while this runs. Saying no only makes those figures smaller.

    What not to do

    • Do not delete a dot folder because its name means nothing to you. .ssh and an app's config folder look exactly like a cache.
    • Do not run a command that removes every .DS_Store on the disk to save space. They are tiny, and Finder writes them back.
    • Do not leave the permanent setting on if you share the Mac with someone less used to it. A dragged system file is easy to miss.
    • Do not rely on chflags hidden to protect anything private.

    Where Mole fits

    Mole's Analyze tab already includes hidden items, with no shortcut to press, so a large ~/.docker or ~/.gradle shows up beside your ordinary folders, and most dot-folders draw with a dimmed list icon. Hover a row or tile and known folders carry a short note saying what they hold. Moving something to the Trash is your choice from the right-click menu, and Finder's Put Back undoes it. A few Apple index folders at the very top of the disk, such as .Spotlight-V100 and .fseventsd, are left out of that top level. Analyze refuses the head of the tree, such as ~/Library itself, and it does not list system areas such as /private at all.

    FAQ

    Why does Command + Shift + . do nothing?

    Click in a Finder window first so Finder is the active app, and use the period key on the main keyboard. In a folder with no hidden items, nothing will change. Some apps draw their own file dialogs, where the shortcut does not apply.

    How do I hide the files again?

    Press Command + Shift + . again. If you used the defaults command, run the delete command above, followed by killall Finder.

    Does showing hidden files slow the Mac down?

    No. It changes which items Finder draws in a list. Nothing is moved, and no file changes.

    Is it safe to delete hidden files?

    Some are and some are not, which is why the name alone is not enough. Find out what owns the file first, and prefer the owning tool's clean command. Move it to the Trash rather than deleting it outright, so you can put it back if something stops working.

    How do I show hidden files in an Open or Save dialog?

    Press Command + Shift + . while the dialog is open. The items appear dimmed in the list, and you can select them there.

    If your Mac is running out of space, try Mole to clear out junk and find large files.

    Try Mole

    Keep reading

    • StorageHow to Clean Up Disk Space on Mac Without Losing Files7 min read
    • StorageWhat Is the Application Support Folder on Mac and What Can You Delete5 min read
    • StorageWhat Is the sleepimage File on Mac and Can You Delete It5 min read

    Mole · 鼹

    Keep your Mac clean and light.

    v1.20.0 (371) · Release notes

    Product

    Mac Cleaner App Uninstaller Mac Optimizer Disk Analyzer System Monitor

    Support

    Help Documentation Releases Blog

    Legal

    Terms of Service Privacy Policy Refund Policy

    Resources

    For Windows CLI Tool Storage Cost Affiliate Program

    Connect

    Twitter hi@mole.fit

    Mole’s only official website mole.fit, avoid installers from unknown sources

    The CLI stays free for terminal workflows.