Sub topic 18
Hidden files and Go to Folder
This chapter assumes you can open a Finder window, move between folders, and know the Home folder from the earlier chapters. You also need to be able to open Terminal and type a command. The Terminal parts are optional.
Why the Finder hides things
The Finder hides items that the system and your apps need but that you rarely need to touch. They fall into three groups:
- Dot files and dot folders. Any name that starts with a period, such as
.zshrc,.sshor.Trash, is hidden by convention. Terminal tools use these for settings. - Items with the hidden flag. The
Libraryfolder inside your Home folder is hidden this way. Many system folders at the top of the disk, such as/usrand/bin, are hidden too. - Housekeeping files.
.DS_Storerecords how the Finder displays a folder, such as its view mode and icon positions. The Finder creates it automatically.
Hiding them protects you. Deleting a settings file or a system folder can break an app or stop your Mac from starting. You should still know how to see these items, because troubleshooting and some app setup instructions send you to them.
Showing hidden files in the Finder
The fastest way is the keyboard shortcut. Press Shift-Command-Period in any Finder window. Hidden items appear as semi-transparent icons. Press the same keys again to hide them.
In recent versions of macOS the shortcut changes the same setting that the Terminal command below changes. If the two seem out of step, press the shortcut once more or restart the Finder.
You can also set the option from Terminal. This is useful if you want to script a setup or keep hidden items visible all the time:
defaults write com.apple.finder AppleShowAllFiles -bool true && killall FinderThe first part writes the preference. The killall Finder part restarts the Finder so that it reads the new value. Your open Finder windows close and reopen. To go back, run the same command with false:
defaults write com.apple.finder AppleShowAllFiles -bool false && killall FinderYou can also list hidden items in Terminal without changing the Finder at all. The -a option of ls includes names that start with a period:
ls -a ~Revealing the Library folder
Your personal Library folder holds app preferences, caches, and saved application data. You open it often when following support instructions, so the Finder gives it two dedicated routes:
- In the Finder, open the Go menu and hold down the Option key. A Library item appears in the menu. Choose it.
- Open your Home folder, choose View > Show View Options (Command-J), and tick Show Library Folder. The folder then stays visible in Home.
The second route is a per-folder view option, like the ones in the sorting and grouping chapter. It makes Library permanently visible without showing every other hidden item.
Go to Folder
Some locations are not reachable by clicking, either because they are hidden or because they are deep in the hierarchy. Go to Folder lets you type a path instead. Press Shift-Command-G or choose Go > Go to Folder. Type a path and press Return.
The field accepts several kinds of path:
| You type | It opens |
|---|---|
| `~` | Your Home folder |
| `~/Library/Preferences` | The Preferences folder inside your Library |
| `/Applications` | The Applications folder at the top of the startup disk |
| `/Users/Shared` | The folder shared by all user accounts |
| `/System/Library` | A system folder that is normally hidden |
The ~ character stands for your Home folder, so ~/Documents is the same place wherever your account lives. A path that begins with / starts at the top of the startup disk.
Go to Folder also helps as you type. Press Tab to complete a folder name, and a drop-down lists matching folders. The field remembers recent paths, which saves retyping.
Go to Folder works on hidden locations whether or not hidden items are showing. You do not need to turn them on first. The folder opens and you can work in it normally.
Getting a path to use elsewhere
Select an item and press Option-Command-C to copy its full path as text. You can then paste it into Go to Folder, a message, or Terminal. For a constant view of where you are, choose View > Show Path Bar. The bar at the bottom of the window shows the chain of folders above the current one.
Hiding and unhiding your own folders
You can set the hidden flag on your own items. This is useful for a folder you want out of sight but still present. Use chflags in Terminal:
chflags hidden ~/Documents/Projects/2026/Archive
chflags nohidden ~/Documents/Projects/2026/ArchiveThe first command hides the folder. The second reverses it. The item is not protected or encrypted. Anyone can still see it with Shift-Command-Period or open it by path with Go to Folder.
How the options relate
Gotchas
A few other points are worth knowing:
- The Finder may be slow to react after
defaults write. If nothing changes, runkillall Finderagain. - Hidden files still count toward folder size and are copied with a folder. A copied folder keeps its hidden contents.
- Some archive tools and file-sharing services skip or include hidden items in different ways. Check the result before you rely on a copy.
Exercise
You are told to edit a settings file in ~/Library/Preferences. Library is not visible in your Home folder. Give two ways to get to that folder in the Finder.
Show answer
Option 1: press Shift-Command-G, type ~/Library/Preferences, and press Return. Option 2: open the Go menu, hold Option, choose Library, and then open the Preferences folder. You could also tick Show Library Folder in Home's view options (Command-J).
Exercise
You run chflags hidden ~/Documents/Projects/2026/Archive. The folder disappears from the Finder. Name a way to see it again without undoing the flag, and the command that does undo it.
Show answer
Press Shift-Command-Period to show hidden items, or open the path with Shift-Command-G. To undo the flag, run chflags nohidden ~/Documents/Projects/2026/Archive.