Use Command Line to Show / Hide Folders in OS X

In the app Terminal for Mac OS X, you can choose to hide folders that are shared in iCloud that show by default. Is git installed on this folder? Well git is a hidden file- so we need to see how to see hidden files to know.

To make a folder hidden type:

chflags hidden

followed by the file path. To get the file path you can drag the file from Finder into Terminal.

chflags hidden /Users/bobsmith/Documents/iOS

To make it public again, change the hidden to nohidden:

chflags nohidden /Users/bobsmith/Documents/iOS

To hide ALL hidden files type this into Command Line.

defaults write com.apple.finder AppleShowAllFiles NO

To show ALL hidden files type this into Command Line.

defaults write com.apple.finder AppleShowAllFiles YES

To restart Finder so the changes take effect type this in after the above line:

killall Finder

In Finder, to toggle between seeing and hiding hidden files use the keyboard shortcut

Command + Shift + Period

Leave a Reply

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