Hide or Show Files and Folders Using Terminal on Mac 1

Hide or Show Files and Folders Using Terminal on Mac

While macOS has always seemed complete to me in more ways than one, there are a few shortcomings that frustrate me from time to time. If the simple dark/light mode and lack of Turbo Boost toggles seem hard to explain, it’s never surprising to me that there isn’t a simple way to hide hidden files. In an age where an extra layer of shielding from prying eyes has become a necessity of the day, there must be a quick way to hide sensitive files, right? So what is the workaround? It turned out to be a valid trick to hide or show files and folders with Terminal on Mac. If you feel comfortable using terminal commands, you may find this hack quite useful. Let’s solve it!

Hide, View, and Unhide Files and Folders with Terminal on macOS

Especially when dealing with a hack like this, it’s always better to clear a few doubts in the beginning.

Are There Any Complexities?

No. So as long as you can easily access (or remember) Terminal commands, you can quickly keep files out of sight on your Mac. If you want to go back and show these files again or view hidden files, you have to go the same route, albeit with different commands (it can work for direct path view too). Since these commands work pretty well and that is without any complexity, you can master them without any hassle. And yes, you don’t need to be running the latest macOS iteration to use this hack either.

  1. Start Terminal application on your Mac. You can use Spotlight search to dive right into the app.

2. Now, command given below. Make sure you haven’t hit the Return key yet.

chflags hidden

Enter the terminal command on your macOS device

3. Next, give Space after that “hidden”.

Leave some space after Hidden

4. Next, go to file or folder you want to hide and then drag to end of command in the terminal window.

Drag the file into the Terminal command window

Drag the folder into Terminal Window

5. Finally, Press the back key.

In relation :  How to Convert Live Photos to Videos in iOS 13 on iPhone

Press the Return Key

Request! The padding on your Mac has disappeared.

Note: Although this command takes effect immediately, sometimes it may not work as expected. In this case, you may need to restart the Finder to make the file disappear.

View Hidden Files and Folders on macOS

Wondering where the file goes and how you can access it? It’s that simple.

  1. Hungry Terminal application on your macOS device and then enter the following command.
defaults write com.apple.finder AppleShowAllFiles -boolean true ; killall Finder

2. Shoot Return key. Now you can view all your hidden files in Finder.

Browse hidden file on macOS

Show Files or Folders on macOS

If you want to show certain files that you have hidden before, you can do so easily.

  1. start terminal Select the app on your Mac and then enter the command given below. Make sure you haven’t hit the Return key yet.
chflags nohidden

2. Then make sure to add a space at the end of the command. Then drag the file to the end of the command and then Return key.

Check, your file is starting to show up in Finder once again. That is all!

Easily Hide and Show Files on Mac

These are quick ways to keep all your private files away from prying eyes. While it works efficiently, I wish Apple offered an easier way to hide files in macOS. It would be better if the option is available in the customize setting or in the contextual menu itself. Well, I say this because I don’t think everyone likes to indulge in Terminal commands – except for a few Mac pro users. What do you say about this? Feel free to drop your thoughts in the comments below.

Moyens I/O Staff has motivated you, giving you tips on technology, personal development, lifestyle and strategies that will help you.