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.

With Terminal, you can access many of the Mac’s hidden features. For example, you can see what files and folders are in a specific folder, or see how Finder hides hidden files and folders.

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

Is there an open terminal found in the Finder application? ..

~/.bash_profile

Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation

This file is part of the GNU Bash shell.

$Id: ~/.bash_profile.orig 00000003a $

This file is generated by the bash shell. It is not subject to $Id$ nor the GNU General Public License.

Set environment variables for the current user. # These variables are not accessible by other users. export PS1="$PS1" export PWD="$PWD" export TMPDIR="/tmp" export PATH="$PATH:/usr/local/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/cellar/gcc-4.7/.libs:/usr/local/include" # Set up a working directory for this user. mkdir -p “$TMPDIR” cd “$TMPDIR” # Add this line to the bottom of the file: # User home directory if [ -f ~/.bash_profile ]; then . ~/.bash_profile fi

If you are not the Mac administrator, you will need to enter your user password and press Enter. ..

alias showFiles=‘defaults writes com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app’”

alias hideFiles=‘defaults write com.apple.finder AppleShowAllFiles YES; 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, you can copy and paste the following: source ~/.bash_profile ..

Final note

This guide will show you how to hide or show files and folders on a Mac using the terminal. If you have any questions about this article, feel free to ask us in the comments below. Additionally, please share this article with your friends if you enjoyed it! ..