How to Hide a Folder on Mac
Sometimes, you just want to keep a folder out of sight.
Maybe it’s a work project, personal files, or just something you don’t want cluttering your desktop. Whatever the reason, hiding a folder on a Mac is easier than you might think, and there are plenty of ways to do it.
The good news? You don’t need to be a tech wizard to get it done. macOS offers some built-in tools and tricks that make hiding folders quick and simple.
Also, if you’re feeling creative or need an extra layer of security, there are more advanced options too.
In this guide, I’ll walk you through eight different ways to hide a folder on Mac. Whether you prefer using Terminal commands, simple renaming tricks, or creating encrypted storage, there’s a method here that’ll work for you.
Here are the methods to hide a folder on macOS.
Method | Description | Difficulty |
---|---|---|
Using Terminal | Hide a folder with the chflags hidden command. |
Intermediate |
Adding a Period | Rename the folder with a period at the start to hide it. | Easy |
Moving to Hidden Location | Place the folder in a directory like ~/Library . |
Easy |
Changing Permissions | Restrict access by setting permissions to “No Access.” | Intermediate |
Compressing Folder | Zip the folder and remove the original to hide it. | Easy |
Fake File Extension | Rename the folder with a system-like file extension. | Easy |
Using Automator | Create a script to toggle folder visibility. | Intermediate |
Encrypted Disk Image | Store the folder in a password-protected disk image. | Intermediate |
1. Hide a Folder Using Terminal
Terminal is a straightforward way to hide folders on your Mac. Follow these steps to make a folder invisible:
- Open Terminal: Press Command + Space to open Spotlight Search, type Terminal, and hit Enter.
- Navigate to the Folder’s Parent Directory: Use the
cd
command to change to the folder’s location. For example:cd /path/to/parent/directory
- Run the Command to Hide the Folder: Type the following command and press Enter:
chflags hidden foldername
Replace
foldername
with the exact name of the folder you want to hide. - Check the Results: Open Finder and navigate to the parent directory. The folder will no longer be visible.
How to Unhide the Folder
If you need to make the folder visible again, follow these steps:
- Open Terminal.
- Run this command:
- Press Enter. The folder will reappear in Finder.
chflags nohidden foldername
Using this method, you can easily hide or unhide any folder without needing third-party tools.
2. Hide a Folder by Adding a Period (.) to Its Name
macOS automatically hides any file or folder that starts with a period (.). Here’s how to use this simple trick to hide your folder:
- Locate the Folder: Open Finder and navigate to the folder you want to hide.
- Rename the Folder: Right-click the folder, select Rename, and add a period (.) at the beginning of the folder’s name. For example, change
MyFolder
to.MyFolder
, then press Enter to save. - Confirm the Folder is Hidden: The folder will immediately disappear from Finder.
How to View Hidden Folders
If you want to access the folder later, you can reveal hidden files in Finder:
- Press Command + Shift + . (period). This toggles hidden files on and off.
- Navigate to the parent directory of the hidden folder. You’ll see the folder grayed out.
How to Unhide the Folder
To make the folder permanently visible again:
- Rename the folder and remove the period at the beginning of its name.
- Press Enter. The folder will now appear as a normal, visible folder in Finder.
This method is quick, easy, and doesn’t require any special tools.
3. Hide a Folder by Moving It to a Hidden System Location
macOS has hidden system directories, such as the Library
folder, where you can store files or folders out of plain sight. Here’s how:
- Access the Hidden Library Folder: Open Finder, press Command + Shift + G, type
~/Library
, and press Enter. - Move Your Folder: Drag the folder you want to hide into the Library folder or its subfolders. For added security, place it deep inside multiple subdirectories.
- Access the Folder Later: Use the Command + Shift + G shortcut to navigate back to its location.
Why Use This Method?
Moving a folder to the Library directory or other hidden system locations keeps it out of view without any renaming or attributes. It’s perfect for casual hiding.
How to Make the Library Folder Visible
- Open Finder and go to your home directory (click Go > Home).
- Click View in the menu bar and select Show View Options.
- Check the box next to Show Library Folder to make it permanently visible in Finder.
4. Hide a Folder by Changing Permissions
You can restrict access to a folder by changing its permissions to “No Access.” This method ensures that the folder can’t be opened or viewed without altering the settings.
- Locate the Folder: Right-click the folder you want to hide and select Get Info.
- Modify Permissions: In the Sharing & Permissions section, click the lock icon to make changes (enter password if prompted). Change the “everyone” permission setting to No Access.
- Save the Changes: Click the lock icon again to save and lock the changes.
What Happens Next?
The folder will still be visible in Finder, but any attempt to open it will result in a “You don’t have permission” message.
How to Restore Access
- Right-click the folder and select Get Info.
- Unlock the Sharing & Permissions section by clicking the lock icon and entering your password.
- Change “everyone” back to Read & Write or the appropriate setting.
- Lock the permissions again by clicking the lock icon.
This method is useful for casual hiding and restricting access to specific users on the same Mac.
5. Hide a Folder by Compressing It
Compressing a folder into a `.zip` file is a quick way to “hide” it while keeping its contents intact. Here’s how:
- Locate the Folder: Find the folder you want to hide in Finder.
- Compress the Folder: Right-click the folder and select Compress [Folder Name]. macOS will create a compressed file with the same name, ending in
.zip
. - Hide or Move the Compressed File: Delete the original folder and move the `.zip` file to a less noticeable location, such as a hidden directory or deep inside subfolders.
Learn more about the .zip command
How to Access the Folder Again
- Double-click the `.zip` file to extract its contents back into the original folder.
- The extracted folder will appear in the same directory as the `.zip` file.
This method is ideal for temporary hiding and organizing sensitive files.
6. Hide a Folder by Renaming It with a Fake File Extension
You can disguise a folder by changing its name to look like a system file or an uncommon file type. This makes it less noticeable. Here’s how:
- Locate the Folder: Find the folder you want to hide in Finder.
- Rename the Folder: Right-click the folder, select Rename, and change its name by adding a fake extension like
.app
,.pkg
, or.log
. Example: RenameMyFolder
toMyFolder.pkg
. - Check the Results: The folder will now look like a file with the fake extension and won’t behave like a folder when clicked.
How to Access the Folder Again
- Right-click the folder and select Rename again.
- Remove the fake file extension (e.g., change
MyFolder.pkg
back toMyFolder
). - Press Enter to restore it as a normal folder.
This method works well for casual hiding and avoids making permanent changes to the folder.
7. Hide a Folder Using Automator
Automator allows you to create a custom script to quickly hide or unhide a folder. Here’s how to set it up:
- Open Automator: Press Command + Space, type Automator, and press Enter.
- Create a New Workflow: When prompted, choose Quick Action as the workflow type.
- Add a “Run Shell Script” Action: Search for “Run Shell Script” in the left sidebar, drag it into the workflow area, and paste this script:
chflags hidden "$@"
- Save the Workflow: Go to File > Save and name your workflow (e.g., “Hide Folder”).
- Use the Quick Action: Right-click the folder you want to hide, go to Quick Actions, and select your script (e.g., “Hide Folder”).
How to Unhide the Folder
Create a second Automator script to toggle visibility back:
- Repeat the steps above, but use this shell script instead:
- Save the workflow as “Unhide Folder.”
- Right-click the hidden folder, go to Quick Actions, and select “Unhide Folder.”
chflags nohidden "$@"
This method is convenient for frequent hiding and unhiding of folders without needing to manually use Terminal.
8. Hide a Folder by Creating an Encrypted Disk Image
You can securely hide a folder by storing it in an encrypted disk image. This method provides both privacy and security. Here’s how:
- Open Disk Utility: Press Command + Space, type Disk Utility, and press Enter.
- Create a New Disk Image: Click File > New Image > Blank Image. In the dialog box, set these key options:
Name Name the disk image Size Choose a size for your folder’s contents Format Set to Mac OS Extended (Journaled) Encryption Select 128-bit or 256-bit AES encryption Password Create a secure password Image Format Set to Read/Write - Save and Mount the Disk Image: Click Save, then double-click the disk image file to mount it as a virtual drive.
- Move Your Folder Into the Disk Image: Drag the folder into the mounted disk image, then eject to secure the contents.
How to Access the Folder
- Double-click the disk image file and enter the password to mount it.
- Access the contents as you would with any other drive.
This method ensures your folder is both hidden and encrypted, making it ideal for sensitive files.