How to hide a file or folder in macOS Finder
By Flavio Copes
Learn how to hide a file or folder in the macOS Finder from the terminal using chflags hidden, and how to make it visible again with chflags nohidden.
~~~
I was slightly annoyed by macOS putting a Public folder in my home folder, with no reason.
I couldn’t delete it as it’s a system folder.
So I found out a way to hide it instead.
Open Terminal and run chflags hidden followed by the path:
chflags hidden ~/Public
Finder hides the item immediately. If it remains visible, relaunch Finder or press Command-Shift-Period to check whether Finder is currently showing hidden files.
To make the item visible again, run:
chflags nohidden ~/Public
Quote paths that contain spaces, for example chflags hidden "$HOME/My Folder".
~~~
Related posts about mac: