
Lately I’ve been dipping into learning web development. Every once in a while, I’ll need access to view and edit hidden files. Luckily there’s a Terminal command you can use to show hidden files in macOS. This is similar to viewing hidden files and folders on a Windows machine.
Just a disclaimer before we get into this tip: Make sure to have a backup of your computer, because working with these files can sometimes make your system unstable if you’re not careful.
Thankfully, all you need to do is paste the command below. Here’s how to show hidden files in macOS.
How to show hidden files on macOS
- Open LaunchPad, and then open Terminal from the Other folder. Alternatively, use Spotlight to find the Terminal app.
- If you’re on macOS Mavericks 10.9 and above, paste this command into Terminal:
defaults write com.apple.finder AppleShowAllFiles TRUE;killall Finder
or if you still using macOS Mavericks 10.8 and below, paste this line of code in Terminal instead:
defaults write com.apple.Finder AppleShowAllFiles TRUE;killall Finder
Hit the Return key after the command is pasted in Terminal and then Finder will be relaunched with the ability to show hidden files. Hidden files or directories will have a grayed out look to them, to differentiate them from the regular files and folders.
If you want to hide files once again, just switch TRUE on command above with FALSE. So the command would be:
defaults write com.apple.finder AppleShowAllFiles FALSE;killall Finder
for macOS Mavericks and above and
defaults write com.apple.Finder AppleShowAllFiles FALSE;killall Finder
for macOS Snow Leopard version and below.
You might not deal with hidden files on a regular basis, but every once in a while, it’ll be helpful to be able to view and edit them. Also, Apple hides some files or directories on purpose, so users won’t be able to make changes that make the system unstable.
If you’re uncomfortable typing in Terminal every time to show hidden files, you can make the command as a snippet within a program like TextExpander or automate it using Keyboard Maestro or BetterTouchTool.
Have you tried to show hidden files on Mac?
Since learning web development in my spare time, I need to access hidden files quite a bit. This tip has been really helpful not only for web development, but in other areas as well. Have you tried viewing hidden files and folders on your Mac? Let me know!