How To Show Hidden Files In MacOS Finder

When you use MacOS finder to browse files, you can not see the hidden files by default. But sometimes you need to show those hidden files in MacOS finder to operate on them such as copy, move etc. This article will tell you two method to show hidden files in MacOS finder.

1. Press Command + Shift + . Key.

  1. Open MacOS finder and go to your desired folder.
  2. Then press Command + Shift + . key on the keyboard.
  3. It will show the hidden files in the finder. Press the key combination again, it will hide all those hidden files.
    show hidden files in macos finder

2. Enable Show Hidden Files Permanently By Script Alias.

If you want to display hidden files every time when you open a MacOS finder, you can write below script alias in MacOS user’s .bash_profile file, and then run the alias. After the alias execution when you open a finder, it will display the hidden files as you want.

  1. Open a terminal and run cd ~ to go to mac user home directory.
  2. Execute sudo vim .bash_profile in terminal to edit .bash_profile file.
  3. Press i to insert text in .bash_profile file. Input below script at the end of .bash_profile file.
    # Define show hidden files alias to show hidden files.
    alias showHiddenFiles='defaults write AppleShowAllFiles YES; 
    # Relaunch MacOS Finder.
    killall Finder /System/Library/CoreServices/'
    # Define hide hidden files alias to hide hidden files.
    alias hideHiddenFiles='defaults write AppleShowAllFiles NO; 
    # Relaunch MacOS Finder.
    killall Finder /System/Library/CoreServices/'
  4. Press esc :wq! to save above file.
  5. Run source .bash_profile to make the changes take effect.
  6. Run showHiddenFiles alias in terminal, then it will restart opened finder and display hidden files.
  7. Run hideHiddenFiles alias in terminal, then it will restart opened finder and hide hidden files.
0 0 votes
Article Rating
Notify of

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

1 Comment
Oldest Most Voted
Inline Feedbacks
View all comments
Ed Arnold
Ed Arnold

Bash didn’t like the newlines between the single quotes in the text box above. I made each alias one line and that seems to work.

# set aliases to show or hide hidden files in macOS
alias showHiddenFiles=’defaults write AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/’
alias hideHiddenFiles=’defaults write AppleShowAllFiles NO; kill Finder /System/Library/CoreServices/’

Would love your thoughts, please comment.x