# How to Hide/Show Files and Folders Using Mac Terminal

**URL:** https://www.compsmag.com/blogs/how-to-hide-show-files-and-folders-using-mac-terminal/
**Author:** Ayushi Chauhan
**Published:** 2022-02-07
**Updated:** 2022-02-07
**Categories:** Blogs
**Tags:** Apple Guides, Blogs Daily, guiderobert, Guides and Tutorials, guiding12, How To Guide, How To Guides, Tips, Tips and tutorials, Tricks
**Reading Time:** 3 min

---

This tip is about the how to Hide/Show Files and Folders Using Mac Terminal. So read this free guide, How to Hide/Show Files and Folders Using Mac Terminal step by step. If you have query related to same article you may contact us.

## How to Hide/Show Files and Folders Using Mac Terminal - Guide

Your Mac has some secrets, hidden folders and files that are invisible to you.  You may not even be aware of how much hidden data is on your Mac, from basic things like preference files for user and application data to basic system data your Mac needs to operate properly.  Apple hides these files and folders to prevent you from accidentally changing or deleting important data your Mac needs.  Apple's reasoning is correct, but you may need to visualize these inaccessible areas of your Mac's file system. Accessing these hidden areas of your Mac is one of the steps in many Mac troubleshooting guides, as well as guides to support up important data such as email messages or Safari bookmarks.

Fortunately, Apple offers ways to access these features on OS X and the latest macOS.  This article focuses on using the Terminal application, which provides a command-line-like interface for many of the main Mac functions. With Terminal, all it takes is a simple command for your Mac to reveal its secrets.  Now that Finder shows hidden files and folders, can you see what exactly?  The answer depends on the specific folder you're looking for, but in almost every folder you'll find a file called .DS_Store.  The DS_Store file contains information about the current folder, including the icon to use for the folder, the location where the window opens, and other information that the system needs.

## How to    hide/show files and folders using terminal on Mac

Open terminal found in Finder?Application?

“sudo nano ~/.bash_profile” in the terminal copy and paste the following.

If necessary, enter your Mac administrator password and press Enter.

“alias showFiles='defaults writes com.apple.finder AppleShowAllFiles YES;  killall Finder /System/Library/CoreServices/Finder.app'” copy and paste the following at the bottom of the “open.bash_profile.

After following the step, copy and paste the commands mentioned below: “alias hideFiles='defaults write com.apple.finder AppleShowAllFiles NO;  killall Finder /System/Library/CoreServices/Finder.app'”

After copying and pasting, press ctrl+O and press Enter to save the file or folder.

After saving the file or folder, press ctrl+X to exit the file or folder and return to Mac terminal command setup.

After returning to the Mac terminal command, copy and paste the following:source ~/.bash_profile

## Final note

I hope you like the guide How to Hide/Show Files and Folders Using Mac Terminal. In case if you have any query regards this article you may ask us. Also, please share your love by sharing this article with your friends.

---

*End of Article*