How To Show Hidden Files On Mac Computer

By Bruce Harrell
how to show hidden files on mac computers

Do you know how to show hidden files on Mac computers yet? Viewing them will help you to find out more information about the macOS operating system. Give us a minute to explain how to show and hide these important hidden files and folders!

Like other operating systems, macOS also keeps important files and folders hidden to prevent them from being deleted accidentally. The reason is that they perform some significant functions. It's hard to break something you can't see, isn’t it?

Typically, the hidden files and folders in macOS that you won't be able to see by default will start with a dot, e.g., .htaccess file, .bash_profile, or .svn folder. The directories like /usr, /bin, /var, and /etc are hidden out of view, too.

Occasionally, in some cases, you may need to show hidden files on your Mac to fix a problem you are having, or to explore the Library folder and clear out old logs, caches, or other junk files.

Below, we have described three easy ways to show hidden files on a Mac.

Three Ways To Show Hidden Files On Mac Computer

One way is to use a keyboard shortcut, one is typing a line of command in Terminal, and the last is to execute an AppleScript.

Let's dive in to find out how to show hidden files and folders on your Mac!

How To Show Hidden Files On Mac With Keyboard Shortcut

The quickest way to view all the hidden files and folders on your Mac is to use the Command + Shift + . keystroke. It's the same as tapping a toggle button that jumps between on and off state, respectively, to show and hide hidden files on Mac.

To make this work, open the Finder app and then press Command + Shift + . to show hidden files. Press this key combination again to hide them!

Unfortunately, this keyboard shortcut is only applicable if your Mac is running the Mac Sierra OS or above.

How To Show Hidden Files On Mac With Terminal Command

If you are more comfortable using the command-line app than the keyboard shortcut to show hidden files and folders, then follow this instruction:

1. Open the Spotlight search bar (Command + Spacebar) and type in: Terminal, then press the Enter key to launch the Terminal app.

Launch Terminal app with Spotlight

2. Copy the following command, paste it into the Terminal app, and then press the Enter key.

defaults write com.apple.finder AppleShowAllFiles YES

3. Next, type in the 'killall Finder' command and press the Enter key to execute it. Otherwise, you can hold down the Option key, do a right-click on the Finder icon in the Dock, and then click the Relaunch option.

relaunch Finder macOS

Both the 'killall' command and 'Relaunch' option will do one thing, to restart the Finder for the change to take effect. Once it's done, you will see hidden files and folders on your Mac.

To switch the files and folders back to hidden, repeat step number #2 and number #3, but change the "YES" value in the command to "NO". The Terminal command should be:

defaults write com.apple.finder AppleShowAllFiles NO

Once it's done, the hidden files and folders on your Mac will become invisible again!

How To Show Hidden Files On Mac With AppleScript

What is AppleScript?

It's a scripting language that was created by Apple to automate repetitive or time-consuming macOS actions. It interacts primarily with apps and Finder to automate tasks for you. Whether it’s a simple task like copying files or as complicated as building a real estate catalog, AppleScript can perform the necessary actions quickly and intelligently.

To make hidden files visible using AppleScript, press the Command + Spacebar to launch the Spotlight search bar, type in: Script Editor, and then press the Enter key to start the Script Editor tool.

Next step, you need to copy and paste the following script into the tool.

display dialog "Do you want to show hidden files on your Mac?" buttons {"Show Files", "Hide Files"} with icon caution default button ("Show Files") giving up after 5
set result to button returned of result
if result is equal to "Show Files" then
do shell script "defaults write com.apple.finder AppleShowAllFiles YES"
do shell script "killall Finder"
display notification "All hidden files have been set to visible!" with title "Show macOS Hidden Files" sound name "Beep"
else if result is equal to "Hide Files" then
do shell script "defaults write com.apple.finder AppleShowAllFiles NO"
do shell script "killall Finder"
display notification "All hidden files have been set to invisible!" with title "Hide macOS Hidden Files" sound name "Beep"
end if

Lastly, click the Run button to execute the script.

A new dialog will show up to give you two options: Show Files and Hide Files. Choose the appropriate option to show or hide hidden files on your Mac computer.

show hidden files mac with applescript

Also, you can save this script as an app to use later! Every time you want to show or hide hidden files and folders, simply click on this saved app and pick the appropriate option.

show hidden files mac application

Final Words

Important files and folders in macOS are typically hidden for a very good reason, namely to protect the operating system and its apps from the user accidentally meddling in a potentially catastrophic way. It's better to leave these files and folders alone unless you absolutely feel the need to make them visible.

The quickest and easiest way to show hidden files on the Mac is to hit the Command + Shift + . keystroke, but there are still other options you might like to consider, such as using Terminal or AppleScript. Generally speaking, if you aren't sure about things you are going to do, we suggest keeping them invisible to avoid accidental removal. When you have to do any meddling, make backups beforehand, just in case any data is lost.

Related Posts

Leave a Comment