Mac

Show Hidden Files on Mac using Terminal

Mac is a great operating system. But it is kind of hard to use. Some of its features are not easily understood. You can learn to use windows easily while you explore the features. You have to go an extra mile when it comes to mac. One of the option which is not directly available is to show hidden files on mac. Today, I will be showing you how to view hidden files on Mac OS X.

How to Show Hidden Files on Mac (Long Method):

  • Open Terminal (Press ⌘ + Space and type Terminal or Go to Finder -> Applications -> Utilities).
  • Paste the following code and hit return :
defaults write com.apple.finder AppleShowAllFiles YES
  • Holding the Option/Alt key, Right Click the Finder icon.
  • Click Relaunch.
  • Now you can see all the hidden files and folders on your Mac.

How to Hide Hidden Files on Mac (Long Method):

  • Open Terminal.
  • Paste the following code and Hit Return.
defaults write com.apple.finder AppleShowAllFiles NO
  • Hold the Option/Alt key and Right Click the Finder Icon.
  • Click Relaunch.
  • Now you will not be able to see the hidden files and folders on Mac.

How to View Hidden Files on Mac using Alias (Shortcut Method) :

Every time you want to hide or show hidden files and folders on mac, you have to remember the long command. Honestly I cannot remember and I have to search on google for the command. So, now I will be showing a method to give an alias (shortcut) to the above mentioned commands.

  • Open Terminal and paste the following code :
sudo nano ~/.bash_profile
  • Enter your mac’s password if prompted.
  • Now paste the following codes one by one :
alias showfiles=’defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app’
alias hidefiles=’defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app’

Finally type the following to save your profile and aliases to take effect :

source ~/.bash_profile

Replace ‘showfiles‘ and ‘hidefiles‘ with any alias you want. Now you just have to type ‘showfiles’ to show hidden files and type ‘hidefiles’ to hide the hidden files and folders.

Remember that the alias is case sensitive. If you give ‘ShowFiles’ as an alias then you have to type ‘ShowFiles’ for the command to work. When you use alias, you need not Relaunch the Finder. If you observe the alias above, we are using ‘killall’ command to relaunch the finder.

Hope you like this post. Please subscribe to our newsletter to get similar posts in your inbox. Also share it on your social networks to support my blog.

You are Special ! You deserve to get Special Content from us.
Get latest tips & tricks, offers, post updates, special exclusive content delivered directly to your inbox.
Tags

Leave a Reply

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