How To Show Hidden Files In MacOS Finder

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

1. Press Command + Shift +. Key.

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

2. Enable Show Hidden Files Permanently By Script Alias.

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

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

1 Comment
Newest
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 com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app’
alias hideHiddenFiles=’defaults write com.apple.finder AppleShowAllFiles NO; kill Finder /System/Library/CoreServices/Finder.app’

1
0
Would love your thoughts, please comment.x
()
x