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.

[box type=”shadow” align=”” class=”” width=””]Also Read :

How to take Screenshots on Mac

Change Location of Screenshots on Mac

Encrypt Folders with Password on Mac[/box]

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 :

[box type=”shadow” align=”” class=”” width=””]defaults write AppleShowAllFiles YES[/box]

  • 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.

[box type=”shadow” align=”” class=”” width=””]defaults write AppleShowAllFiles NO[/box]

  • 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 :

[box type=”shadow” align=”” class=”” width=””]sudo nano ~/.bash_profile[/box]

  • Enter your mac’s password if prompted.
  • Now paste the following codes one by one :

[box type=”shadow” align=”” class=”” width=””]alias showfiles=’defaults write AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/'[/box]

[box type=”shadow” align=”” class=”” width=””]alias hidefiles=’defaults write AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/'[/box]

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

[box type=”shadow” align=”” class=”” width=””]source ~/.bash_profile[/box]

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. Get VIP Content in your Inbox

Subscribe to receive latest post updates, special offers, coupons and other VIP content exclusively to our members.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.