Show Hidden Files on Mac | Quickly with Aliases

Show Hidden Files on Mac

Show Hidden Files on Mac OS X

Time and again I have searched the net when I wanted to show hidden files on Mac OS X.  Then again when I needed to hide files on a Mac OS X.

This guide will show you how to speed up the process by creating an alias. Once finished, you won’t have to search the net for the correct method. You’ll simply type showFiles or hideFiles in the Terminal instead of the usual and lengthy command strings.

Show/Hide Hidden Files the Normal Way

First, refresh yourself on the normal way to show/hide hidden files on a Mac (OS X El Capitan 10.11, Yosemite 10.10, and OS X Mavericks 10.9):

Show hidden files on a Mac

  1. Open Terminal (search Terminal in Spotlight and click to launch)
  2. Copy/Paste the following command string:

defaults write com.apple.finder AppleShowAllFiles TRUE;killall Finder

  1. Press Return on the keyboard

Hide hidden files on a Mac

  1. Open Terminal (search Terminal in Spotlight and click to launch)
  2. Copy/Paste the following command string:

defaults write com.apple.finder AppleShowAllFiles FALSE;killall Finder

  1. Press Return on the keyboard

Surely not the most cumbersome set of instructions. But, who wants to take the time to search online or memorize those command strings? Not me.

Show/Hide Hidden Files using Terminal Aliases

You can set up your system to use aliases like “showFiles” and “hideFiles” to replace those lengthy command strings that you normally use.

  1. Open Terminal
  2. Copy/Paste into Terminal: sudo nano ~/.bash_profile
  3. Press Return on the keyboard
  4. Enter your admin password.  The cursor will not move or show what is typed.
  5. Press Return on the Keyboard
  6. At the bottom of the open .bash_profile file, Copy/Paste the following:

alias showFiles='defaults write com.apple.finder AppleShowAllFiles TRUE; killall Finder /System/Library/CoreServices/Finder.app'

  1. Press return on the keyboard to move to the next line
  2. Copy/Paste the following:

alias hideFiles='defaults write com.apple.finder AppleShowAllFiles FALSE; killall Finder /System/Library/CoreServices/Finder.app'

  • To save the filer: Press ctrl + o and press Return on the keyboard.
  • To exit the file and return to the command line:  Press ctrl + x
  • To make the aliases available, copy/paste the following into the Terminal:

source ~/.bash_profile

  1. Press Return on the keyboard

Conclusion: Show Hidden Files on Mac Quickly with Aliases

With the aliases set up you no longer need to search online for the proper command lines and your interaction with the Terminal is much easier. All you do is type showFiles or hideFiles to show or hide your Mac’s hidden files.

Leave a Reply

Your email address will not be published. Required fields are marked *