Finder: show hidden files with one shortcut
The quickest way needs no settings and no Terminal. It is a toggle, so nothing is changed permanently.
- Click a Finder window. The window has to be the active one, otherwise the keys do nothing.[1]
- Press Shift-Command-. Use the full stop next to the comma, not the one on a numeric keypad.[1]
- Look for the dimmed items. Hidden files and folders are drawn fainter than ordinary ones, so you can tell which is which.[1]
- Press the same keys again when you have finished, and they disappear.[1]
If nothing new appears, the folder may simply contain no hidden items.[1] Your home folder is a good place to check that the shortcut is working, because it always has some: press Shift-Command-H to open it first.[7]
Two kinds of file stay out of sight even with the shortcut on. Howard Oakley of The Eclectic Light Company notes that .DS_Store files and the ._ companion files found on some external drives remain invisible in the Finder when other hidden items are shown.[2] For those you need Terminal, covered below.
View hidden files on a Mac in Open and Save dialogs
The same shortcut works inside the Open and Save dialogs that apps show.[1] That is the easy way to open a file such as .zshrc in a text editor, or to attach something from inside a hidden folder, without changing how the Finder looks. Click inside the dialog first, then press Shift-Command-.[1]
macOS: show hidden files all the time with Terminal
If you work with hidden files every day, you can tell the Finder to show them in every window, permanently. Open Terminal (it is in the Utilities folder, which Shift-Command-U opens[7]) and run these two lines:[1]
defaults write com.apple.finder AppleShowAllFiles -bool true
killall FinderThe first line changes a Finder preference. The second restarts the Finder so the change takes effect; your windows close and reopen.[1] To go back, run the same pair with false in place of true.[1]
defaults write com.apple.finder AppleShowAllFiles -bool false
killall FinderFor most people the shortcut is the better habit. Hidden files are hidden because they are easy to break and rarely interesting, and a permanently cluttered Finder makes an accidental drag to the Trash more likely.
Show hidden files in Terminal with ls
Terminal does not use the Finder's rules, so it can list everything, including the files the Finder refuses to show. The -a option of ls lists all entries, including those whose names start with a dot.[5]
ls -a ~
ls -la ~/Documents
ls -lO ~- `ls -a ~` lists your home folder with its dot files. The entries
.and..stand for the current folder and the one above it.[1] - `ls -la` adds the long format, with owner, size and date for each item.[5] Use
-Ain place of-ato leave out.and...[5] - `ls -lO` adds each item's file flags to the long listing, which is how you see whether something carries the
hiddenflag.[5][4]
This is also the reliable way to see .DS_Store files, which Oakley says have stayed out of the Finder's view since macOS Sierra even when it shows other invisible files.[9]
How to find the Library folder on a Mac
Most searches for hidden files are really searches for one folder: the Library inside your home folder, written ~/Library. It holds your apps' settings, support files and caches, and the Finder has hidden it since OS X 10.7.[3] It is not a dot file, so it behaves a little differently. There are four ways in.
| Method | Steps | Lasts |
|---|---|---|
| Go menu | In the Finder, hold Option and choose Go › Library.[6][8] | One visit |
| Go to Folder | Press Shift-Command-G, type ~/Library, press Return.[7][6] | One visit |
| View Options | Choose Go › Home, then View › Show View Options, and tick Show Library Folder.[8] | Until you untick it |
| Terminal | Run chflags nohidden ~/Library.[4][1] | Until you run chflags hidden ~/Library[1] |
The View Options route is the one Apple documents for keeping the folder visible, and the checkbox is offered when your home folder is the one in front, which is why the steps start with Go › Home.[8] The steps above were checked against Apple's Mac User Guide for macOS 26 Tahoe.[8]
Go to Folder is worth learning properly, because it reaches any hidden folder, not just this one. A leading slash starts from the top of the disk, a tilde means your home folder, matching folders are suggested as you type, and Tab accepts a suggestion. You can also paste a path you copied elsewhere.[6]
There are three Library folders, and only one is yours
Apple's developer documentation describes three. The one in your home folder is the most used and holds your own apps' files. /Library, at the top of the disk, is shared between everyone who uses the Mac. /System/Library is reserved for Apple.[3] The top-level one is visible in the Finder, and Apple's guidance for it is blunt.
Don’t use this folder to store files and folders you create.
Inside ~/Library, three subfolders account for most of what people go looking for. Application Support holds an app's data files other than your documents. Caches holds files an app can recreate easily. Preferences holds settings files, which apps are meant to read and write through the system and not by hand.[3] If you are there to free up space, read how to clear System Data on a Mac before deleting anything, because the folder that looks largest is not always the one that is safe to empty.
How files become hidden on a Mac
There are two separate mechanisms, plus a list of folders the Finder hides on its own. Knowing which one applies tells you how to reverse it and whether search will still find the file.
| Mechanism | Example | How to undo it | Found by Spotlight? |
|---|---|---|---|
| Name starts with a dot | .zshrc, .ssh, .git | Rename it without the dot | No. Dot items, and ordinary files inside a dot folder, are left out of all Spotlight results.[2] |
| The hidden flag | Anything you ran chflags hidden on | chflags nohidden and the path[4] | Yes. Items hidden this way still appear in Spotlight.[2] |
| Hidden by the Finder | /usr, /bin, /etc, /Volumes, ~/Library[3] | Show hidden files, or use Go to Folder | Not in a default search; see the Spotlight section below |
The dot rule is inherited from UNIX: any file or folder whose name begins with a full stop is hidden automatically.[3] The flag is a property stored with the file, described in the chflags manual page as hiding the item from the graphical interface.[4] Neither one changes what code can do. Apple's documentation says its file APIs do not filter out invisible items, so apps and Terminal commands see them as normal, limited only by permissions.[3]
How to hide files on a Mac, and why that is not security
You can use both mechanisms on your own files.
- Add a leading dot. The Finder warns against names that start with a full stop. Show hidden files first with Shift-Command-., then rename; the Finder still asks you to confirm, but allows it. To unhide, remove the dot. Because the Finder caches what it shows, you may have to switch to another folder and back before the item reappears.[2]
- Set the hidden flag. In Terminal, type
chflags hiddenand a space, drag the file or folder into the Terminal window to paste its path, then press Return.chflags nohiddenreverses it, and the name does not change.[2]
chflags hidden ~/Documents/Drafts
chflags nohidden ~/Documents/DraftsChoose with search in mind. A flagged item still turns up in Spotlight, while a dot item vanishes from it, along with everything inside a dot folder.[2] Hiding a folder of documents behind a dot therefore also hides them from your own searches.
Hiding is tidiness, not protection. Anyone at your Mac can press three keys and see everything, and any app or Terminal command sees hidden files as normal.[1][3] Oakley's own view is that hiding does little for security beyond keeping things from a casual glance, and he points out that malware uses hidden files to conceal itself.[2] If a file needs protecting, encrypt it. For a document, a password on the PDF is a real lock; a dot in the name is not.
Mac hidden files: what they are and which are safe to delete
Once hidden files are showing, your home folder and the top of the disk fill with unfamiliar names. This table covers the ones you are most likely to meet. The last column is deliberately cautious.
| Item | Where | What it is for | Safe to delete? |
|---|---|---|---|
.DS_Store | Almost any folder | The Finder's record of that folder's custom settings, such as icon positions, plus Finder comments.[9] | Yes, with a small cost: the Finder makes a new one, and that folder's layout and comments are lost.[10][9] |
.Trash, .Trashes | Home folder; top of other volumes | Where items you move to the Trash are kept: .Trash for your account on the startup disk, .Trashes on each other volume.[24][11] | Empty the Trash from the Finder instead of removing the folder. |
.localized | Top of a volume and inside some folders | Holds localised names for the Finder, or is an empty marker file.[10] | Leave it. Oakley's advice is to ignore it.[10] |
.zshrc, .zprofile | Home folder | Settings for zsh, the default shell since macOS 10.15. .zprofile runs at login, .zshrc for each new Terminal session.[22] | Only if you mean to reset your shell setup. Edit, do not delete. |
.ssh | Home folder | Your SSH keys.[1] | No, unless you want to lose those keys. |
.git | Top of a project folder | The Git repository itself: its objects, references and configuration.[23] | No, unless you want to discard the project's version history. |
~/Library | Home folder | Your apps' data, caches and settings.[3] | Not the folder. Individual items only when you know what they are. |
/private | Top of the disk | The real location of /etc, /tmp and /var, which are links into it.[11] | No. |
/usr, /bin, /sbin | Top of the disk | Command-line tools. /bin holds the essential ones.[3] | No, and macOS will not let you; see the section on what you cannot change.[12] |
/etc | Top of the disk | Configuration files specific to this Mac, including the hosts file.[3][20] | No. Edit single files with care. |
/Volumes | Top of the disk | Where every mounted disk appears.[11] | No. |
._name files | Drives not in a Mac format | AppleDouble companions that carry a file's extended attributes.[2] | Yes on a drive bound for a non-Mac device, at the cost of that metadata.[16] |
.Spotlight-V100 | Top of each volume | That volume's Spotlight search index.[10] | Leave it. It is not portable and belongs to that volume.[10] |
.fseventsd | Top of each volume | A log of file and folder changes, used by Time Machine.[10] | Leave it alone. If it is lost, the next backup takes longer.[10] |
.DocumentRevisions-V100 | Top of each volume | The store behind document versions.[10] | No. Changing it breaks versions on that volume.[10] |
.TemporaryItems | Top of each volume | Miscellaneous temporary files.[10] | Leave it to macOS. |
A rule that covers the table: if you did not create it and you cannot say what it does, do not delete it. Deleting hidden housekeeping files is rarely how you get space back. If space is what you are after, look at ordinary folders first; see how to find large files on a Mac and how to clear storage on a Mac.
One more caution from Oakley: third-party software sometimes adds hidden items of its own at the top of a volume, named after their maker, and you have to judge each on its merits, since an unexplained one could indicate malware.[10]
What is .DS_Store
.DS_Store stands for Desktop Services Store. It dates from the 1999 rewrite of the Finder for Mac OS X, and Apple has never documented its format.[9] The Finder normally creates one in any folder you can write to after a change such as copying a file in, and uses it to remember that folder's custom attributes: icon positions, how file details are displayed, and the comments you type into a Get Info window.[9]
On your own Mac these files are harmless and tiny. The trouble starts when a folder leaves the Mac. Oakley lists the usual complaints: they confuse people on Windows or Linux who open an archive made on a Mac, they travel with a folder sent by AirDrop, and they get in the way of revision control and folder comparison.[9] That is why developers add .DS_Store to a project's ignore list.
To remove them from one folder and everything inside it, Oakley gives this command, run from inside that folder in Terminal.[9] The Finder will create new ones as you browse.
find . -name .DS_Store -deleteStop .DS_Store files on network drives
Apple documents one setting for network shares. Its support article on SMB browsing gives the following command, which makes the Finder stop using .DS_Store files on network shares and show folder contents straight away in alphabetical order.[15] Oakley cites the same setting as the way to stop them being written to network volumes on older systems, and adds that recent versions of macOS should no longer write them there.[9]
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUELog out of your account and back in for it to take effect. To restore the normal behaviour, run the same command with FALSE.[15] This applies to network shares only. It does not stop .DS_Store files appearing in folders on your own disk.
Hidden files on an external drive: the ._ files
Plug a USB stick that has been in a Mac into a Windows PC, a television or a car stereo, and you may see a second file beside each real one, with the same name prefixed by ._. These are AppleDouble files. macOS stores extra information with a file, called extended attributes, and some FAT-formatted volumes have nowhere to keep it, so macOS writes it into a companion file instead.[2] Each one belongs to a single file, unlike .DS_Store, which belongs to a folder.[2]
On the Mac you will not see them in the Finder even with hidden files showing.[2] macOS includes a command for cleaning them up, dot_clean, which merges each ._ file back into its real file where it can. With the -m option it always deletes them, which its manual page describes as useful when sharing files with non-Mac machines.[16]
dot_clean -m /Volumes/MYDRIVEReplace MYDRIVE with the drive's name; mounted disks appear under /Volumes.[11] Run it just before you eject, because macOS may write new companion files the next time it copies something to that drive. Other hidden folders at the top of the drive, such as .Spotlight-V100, .fseventsd and .Trashes, are the per-volume items from the table above.[10] A device that shows them is displaying macOS housekeeping, not a fault.
What you cannot change even when you can see it
Showing hidden files makes the system folders visible. It does not make them editable, and that is by design. Three layers of protection sit underneath.
| Protection | Since | What it means for you |
|---|---|---|
| System Integrity Protection (SIP) | OS X El Capitan[12] | /System, /usr, /bin, /sbin, /var and the apps that come with macOS can be changed only by Apple-signed processes such as software updates. Even the root user is restricted.[12] |
| Read-only system volume | macOS Catalina[13] | macOS runs from its own volume, separate from your data. You cannot store files on it or write to the top level of the disk from Terminal.[13] |
| Signed system volume | macOS 11[14] | The system volume carries a cryptographic seal signed by Apple, checked at startup. If the check fails, startup stops and you are asked to reinstall macOS.[14] |
In practice this means sudo does not get you into those places,[12] and a guide that tells you to delete or replace something inside /System is either out of date or asking you to weaken your Mac's security. The areas left open to third-party software are /Applications, /Library and /usr/local.[12]
The split into two volumes also explains an oddity in Disk Utility, which lists Macintosh HD and Macintosh HD - Data separately. The first is the read-only system, the second holds your files, and the Finder presents the pair as a single disk.[13]
Where the Mac hosts file is and how to open it
The hosts file maps a domain name to an IP address on your Mac alone, ahead of DNS. Developers use it to test a site on a new server before the DNS records change, and it can block a site by pointing its name at 127.0.0.1.[20] The file lives at /private/etc/hosts; /etc/hosts is a link to the same file, so either path works.[20][11]
To look at it in the Finder, press Shift-Command-G and type /etc.[7][6] To edit it you need an administrator password and Terminal:[20]
- Open the file. Run
sudo nano /etc/hostsand type your password when asked. Nothing appears as you type it.[20] - Add a line. Use the arrow keys to reach the bottom, then add one entry per line: the IP address, a space, then the domain.[20]
- Save and leave. Press Control-O, then Return to save, and Control-X to exit.[20]
- Clear the DNS cache if the change does not show, with
sudo killall -HUP mDNSResponder.[20]
sudo nano /etc/hosts
sudo killall -HUP mDNSResponderLeave the lines that are already there alone. To undo your change, open the file again and delete the line you added.[20]
Why Spotlight does not find hidden files
Search is the natural next thing to try, and it mostly will not help. Items whose names begin with a dot are excluded from all Spotlight results, and so are normally named files inside a dot folder.[2] Items hidden with the flag are the exception and still appear.[2] System locations are filtered too: by default a Finder search returns nothing from the System folder or the top-level Library folder.[17]
The Finder has an option for the system part. MacMost describes it:[17]
- Start a search in a Finder window and add a search criterion.
- Choose Other as the type of criterion, then search the list for System files and add it.[17]
- Set it to are included.[17]
Treat this as a partial fix. MacMost's guide dates from 2019, we could not find an Apple page documenting the option, and it does not bring back dot files, which are missing from the index in the first place.[17][2] When you know roughly where a hidden file is, Go to Folder or ls -a is quicker and more dependable than search.[6][5] For ordinary documents, finding files by date, size, type or text inside covers what search does well.
Show file extensions, the path bar and a file's full path
Three more things the Finder hides by default are not files at all, and they are often what people mean by hidden.
Show file extensions on a Mac
- For every file. Choose Finder › Settings, click Advanced, and tick Show all filename extensions.[18]
- For one file. Select it, choose File › Get Info, open Name & Extension, and untick Hide extension.[18]
With the first option on, every extension shows, including on files individually set to hide theirs.[18] Apple advises against changing an extension when you rename a file, because the file may then no longer open in the app that made it; to change a format, use an app that can convert it.[18]
Show the path bar and get a file path
- Show the path bar. Choose View › Show Path Bar, or press Option-Command-P. Holding Option shows it momentarily.[19][7]
- Copy a path. Control-click a folder in the path bar and choose Copy "folder" as Pathname, where folder is its name.[19]
- Paste a path into Terminal. Drag a file or folder from the Finder into a Terminal window and its path is typed for you.[2]
- Go to a path. Paste a copied path into Go to Folder and press Return.[6]
Where the Applications folder is on a Mac
The Applications folder is not hidden, but it is searched for often enough to belong here. It sits at the top of the startup disk, at /Applications, and holds apps for everyone who uses the Mac; the App Store installs into it automatically.[3] It contains a Utilities subfolder with tools such as Terminal, which Shift-Command-U opens directly.[3][7] To open Applications itself, choose it from the Finder's Go menu, or use Go to Folder and type /Applications.[6]
Dragging an app out of the folder makes an alias; it does not move the app.[21] The apps that come with macOS are protected by System Integrity Protection, so they cannot be altered from here.[12] An app's own hidden contents are a separate matter: an app is a folder that the Finder presents as a single file, called a package or bundle.[3]
Apps that show hidden files
Since the shortcut is built in, few people need an app for this. One that exists for the purpose is Funter, from Nektony. According to its site it shows and hides hidden files in the Finder, hides a file with a click, and searches for hidden files by name across a disk or folder, which is the thing Spotlight will not do. The site lists it as free at the time of writing (November 2026), for macOS 11 and later, and says plainly that it is not a replacement for Spotlight.[25] We have not tested it; that description is the vendor's.
If the reason you are looking at hidden files is a full disk, a storage map is more useful than a file toggle. Disk space analysers for Mac compares those.
Where Orrel fits, and where it stops
Orrel is a Mac app we make, and it is not a hidden-file browser. Its search reads the Spotlight index for your home folder and Applications, on your Mac, and lets you search by name, kind, size, date and the text inside documents using plain phrases such as "pdfs from last week over 5 mb". Quick search opens from any app with Shift-Command-Space.
Because results are limited to what Spotlight has indexed, Orrel does not find hidden system files or dot files, and it is not a way to browse /usr, /etc or ~/Library. For those, the shortcut, Go to Folder and Terminal on this page are the right tools, and they are free. Orrel is for the other problem: finding your own documents when you remember what they were about and not what they were called. Orrel vs Spotlight sets out when the built-in search is enough. Orrel has a 3-day trial, then costs $15 once for one Mac, and needs macOS 14 or later.
What to do next
- You only wanted a look. Press Shift-Command-. again and leave everything as it was.
- You were hunting for space. Hidden files are rarely the cause. Start with how to clear storage on a Mac, then how to clear System Data.
- You were looking for a document. It is probably not hidden. Try searching by date, size, type or contents.
- You were told to delete a hidden file. Check it against the table above first, and move it to the Trash before emptying, so you can put it back.
Questions
What is the shortcut to show hidden files on a Mac?
Press Shift-Command-. with a Finder window active. Hidden items appear dimmed, and pressing the same keys again hides them. The shortcut also works in the Open and Save dialogs of other apps.[1]
Why can't I see the Library folder on my Mac?
The Finder has hidden the Library folder in your home folder since OS X 10.7.[3] Hold Option and choose Go › Library to open it once. To keep it visible, choose Go › Home, then View › Show View Options, and tick Show Library Folder.[8]
Is it safe to delete hidden files on a Mac?
Some, not most. .DS_Store files can go, because the Finder recreates them, though that folder's layout and Finder comments are lost.[10][9] Leave .fseventsd, .Spotlight-V100 and .DocumentRevisions-V100 alone, since macOS relies on them.[10] System folders such as /usr and /System are protected and cannot be changed anyway.[12]
Can I delete .DS_Store files?
Yes. They hold a folder's Finder settings, such as icon positions, and its Finder comments, so you lose those for that folder, and the Finder makes a new file when it next needs one.[9][10] To remove them from a folder and everything inside it, run find . -name .DS_Store -delete in Terminal from that folder.[9]
How do I show hidden files in Terminal on a Mac?
Run ls -a to list everything in the current folder, including names that start with a dot, or ls -la for sizes and dates as well.[5] To make the Finder show hidden files permanently, run defaults write com.apple.finder AppleShowAllFiles -bool true and then killall Finder.[1]
How do I hide a file or folder on a Mac?
In Terminal, type chflags hidden, a space, drag the item in to paste its path, and press Return. chflags nohidden brings it back. Renaming the item to start with a dot also hides it, and removes it from Spotlight results too.[2] Neither method protects the file; anyone can reveal it with the Finder shortcut.[1]
Where is the hosts file on a Mac?
At /private/etc/hosts. /etc/hosts is a link to the same file. Edit it in Terminal with sudo nano /etc/hosts, which asks for an administrator password.[20]
References
- Show Hidden Files on Mac. Mac Install Guide.
- How to hide files and folders. The Eclectic Light Company, 3 July 2024.
- File System Programming Guide: File System Basics. Apple Developer.
- chflags manual page (macOS). SS64.
- ls manual page (macOS). SS64.
- Go directly to a specific folder on Mac. Apple Support.
- Mac keyboard shortcuts. Apple Support, 14 September 2026.
- Mac User Guide glossary: Library folder. Apple Support.
- Explainer: .DS_Store files. The Eclectic Light Company, 15 November 2025.
- Hidden files and folders on APFS volumes. The Eclectic Light Company, 9 December 2021.
- What are all those hidden folders then?. The Eclectic Light Company, 1 March 2018.
- About System Integrity Protection on your Mac. Apple Support, 20 March 2025.
- About the read-only system volume in macOS Catalina or later. Apple Support, 2 June 2026.
- Signed system volume security. Apple Platform Security, 13 May 2022.
- Adjust SMB browsing behavior in macOS. Apple Support, 29 February 2024.
- dot_clean manual page (macOS). SS64.
- Include System Files In Finder Search. MacMost, 26 June 2019.
- Show or hide filename extensions on Mac. Apple Support.
- Get file, folder, and disk information on Mac. Apple Support.
- How to find and edit your Mac hosts file (in 4 steps). Kinsta, 19 May 2026.
- Folders that come with your Mac. Apple Support.
- Use zsh as the default shell on Mac. Apple Support, 15 June 2026.
- gitrepository-layout: Git repository layout. Git.
- Trash (computing). Wikipedia.
- Funter - Show Hidden Files on Mac. Nektony.