Displaying Hidden Files and Folders

This is a free resource from my online course, From Idea To Launch, where I teach you how to build a full Laravel web application, step by step, at beginner's speed. Learn more →

Your computer designates some files and folders to be hidden — or invisible, by default. And for a good reason: because you usually don’t need to be messing with them.

But in some cases, you do need to access and modify these files. Here’s how you get them to show up.

On a Mac

  1. Run the following command in Terminal:

    $ defaults write -g AppleShowAllFiles -bool true
  2. Hold alt on your keyboard, then right click on the Finder icon in the dock and click Relaunch
  3. Restart Sublime Text — and any other applications in which you wish to open hidden files/folders.

If that doesn’t work, try this:

Press ⌘ command + ⇧ shift + . while the Open File dialog is open — say, when you’re trying to open a file in Sublime Text — and that will toggle (show/hide) hidden files.

In Windows

  1. Open Folder Options by clicking the Start button, clicking Control Panel, clicking Appearance and Personalization, and then clicking Folder Options.
  2. Click the View tab.
  3. Under Advanced settings, click Show hidden files and folders, and then click OK.

I can’t edit the hosts file — no matter what I try I get “Access Denied.”

It could be related to virus software you’re running. Check out your virus protection software’s settings and see if there’s anything restricting file permissions.

Software-specific fixes:

A fix for Webroot