Do you often need to hide files on your Mac? Perhaps you have to do a presentation on your Mac and don’t want others to see what’s on your desktop or in your Finder. It could be that your desktop is so overwhelmed with files and folders that it becomes unsightly, or there may be confidential stuff that isn’t uitable for the public. Whatever the reason, you are probably looking for a way to quickly hide files, folders and desktop icons on your Mac. This tutorial shows you how to hide files, folders and icons on your Mac desktop and in Finder.
- How to Hide Desktop Icons Using Terminal
- How to Use Finder to Hide Device Icons
- How to Hide Files With System Commands
- How to Hide Files With a Period
- How to Set the Visibility Attribute to Invisible
- How to Reveal Hidden Files in Finder
- How to Hide Files in System Folders
- How to Hide Files Using FileVault
- Frequently Asked Questions
How to Hide Desktop Icons Using Terminal
- Open the Terminal app from the Launchpad.
- Type in the following command and press Enter to hide everything on your desktop. Your desktop should be blank, without even a single icon on it.
defaults write com.apple.finder CreateDesktop false killall Finder
How to Unhide Icons on the Desktop Using Terminal
To unhide the icons on your desktop with Terminal, launch Terminal, type in the following command and press Enter.
defaults write com.apple.finder CreateDesktop true killall Finder
All your files and folders will now reappear on the desktop.
How to Use Finder to Hide Device Icons
Make sure you are inside a Finder window. If you are on your desktop, you are already there.
- Click on the “Finder” menu on the top and select “Settings … “
- When the panel opens, make sure you are in the “General” tab.
- Under the “Show these items on the desktop” section, uncheck all of them so that they will no longer be a part of your desktop.
- As soon as the items are unchecked, they will be removed from your desktop, helping you keep your desktop uncluttered.
If you want to make some files or folders disappear, there are several methods to hide files and folders on your Mac. This won’t encrypt the files, but it will make them invisible while browsing in Finder.
How to Hide Files With System Commands
macOS offers a couple of ways that allow experienced users to employ system functionality to hide files. They all involve Terminal in varying capacities. There are also apps that will execute these commands behind a graphical interface if you’re not confident with the command line.
How to Set the Hidden Flag in Terminal
- Open Terminal.
- Type the following commands, but don’t press the Enter key just yet:
- Drag the file or folder you want to hide into the Terminal window.
- Once the path appears in the Terminal window, press Enter to set the
- Remove the hidden flag with the same process, but change the command to
How to Hide Files With a Period
Files or folder names that start with a period (“.”) are automatically hidden in Finder. You can use Terminal to add a period to the beginning of any file or folder’s name, hiding the file from casual view.
- Open Terminal.
- Navigate to the folder containing the file you want to hide in Terminal using the
- Use the
mvcommand to “move” the file you want to hide from its current name to one starting with a period:
mv myfile .myfile
- All your files and folders will now reappear on the desktop.
- To reverse this process, just invert the command:
mv .folder folder
How to Set the Visibility Attribute to Invisible
If you have Xcode or Apple Developer Tools installed, you can also use the visibility attribute.
- Open Terminal.
- Type the following command but don’t press Enter yet:
setfile -a V
- Drag the file or folder into the Terminal window.
- Press Enter to execute the command and hide the file.
- To undo the command, change the uppercase
Vto a lowercase
setfile -a v file.txt
How to Reveal Hidden Files in Finder
Locking a door doesn’t do much good if you cannot also unlock it. There are two main ways to do it, and both will reveal all hidden files, regardless of the method used to hide them.
Both have the same effect, and the second is typically easier to remember and execute on the fly.
Of course, advanced users will know you can always see hidden files and folders in Terminal with
You can also employ Finder’s “Go to Folder” command to navigate directly into a hidden folder, provided you know the exact path.
How to Reveal Hidden Files With Terminal
- Run the command below in Terminal to reveal all hidden files.
defaults write com.apple.finder AppleShowAllFiles TRUE ;killall Finder
- Finder will restart after you run this command, so make sure you’re not in the middle of emptying the trash or copying files.
- When you’re done, re-hide the files by changing the
TRUEin the previous command to
FALSE, like so:
defaults write com.apple.finder AppleShowAllFiles FALSE ;killall Finder
How to Reveal Hidden Files with Finder
- Open a Finder window and press Command + Shift + Period to reveal all hidden files.
- Hide files again by pressing the same key command: Command + Shift + Period.
How to Hide Files in System Folders
You can also hide files by putting them in system folders. This is the kind of trick you would use to hide confidential materials from a snooping user.
By default, the Library folder is hidden on macOS, making it a useful place to stow files where they’re easily accessible.
- Click on the “Go” menu in Finder.
- Hold down the Option key to reveal the “Library” menu option.
- Click on “Library” to navigate to the folder.
- Create a new folder within the Library folder and name it whatever you’d like.
- Place your sensitive files inside that directory.
How to Hide Files Using FileVault
The security feature on your Mac called FileVault can encrypt your entire drive to conceal sensitive files. FileVault creates a folder that is invisible and requires administrator login credentials to become accessible.
- Launch the System Settings app on your Mac.
- Select “Privacy and Security” from the sidebar.
- Locate the FileVault menu and select the button labeled “Turn On … ” You may be asked to enter your login credentials.
- Choose a recovery method. You can create a recovery key and write it down or use iCloud to unlock your disk.
- Restart your Mac.
Frequently Asked Questions
Do hide/unhide workflows work the same on all Macs?
Yes, the procedures and Terminal commands listed above will work on most modern versions of macOS, including Mac desktops and notebook computers. These methods have even been tested on the latest build of macOS Ventura. If you would like to take guarding your files a step further, you can learn about password-protecting folders.
Can I recover files that I accidentally deleted using the Trash?
You can by performing a two-finger click on a trashed file, then selecting “Put Pack” from the drop-down menu. If you would like to recover files that have already been deleted, you can use an app like Disk Drill to perform a deep system scan.
Is Xcode required to configure visibility attributes?
Yes. You can visit the App Store app, then download and install the latest version of Xcode for free.
Image credit: Jeremy Bezanger via Unsplash All screenshots taken by Brahm Shank
Our latest tutorials delivered straight to your inbox