As a macOS user, you may sometimes come across unnecessary system folders, such as the “Public” folder, in your home directory. Although you can’t delete these system folders, you can hide them from view. In this article, we will show you how to easily hide a file or folder in macOS Finder using the terminal.

To get started, follow these steps:

  1. Launch the Terminal application on your macOS device.
  2. In the Terminal window, type the following command and press Enter:
    chflags hidden <path>
    
    Replace <path> with the path to the file or folder you want to hide. For example, if you want to hide the “Public” folder, the command would be:
    chflags hidden Public
    
    This command sets the “hidden” attribute for the specified file or folder, making it invisible in Finder.

That’s it! Your file or folder will now be hidden from view in macOS Finder.

If you need to set the file or folder back to visible, simply use the following command in the Terminal:

chflags nohidden <path>

Again, replace <path> with the path to the file or folder you want to make visible again.

By following these simple steps, you can easily hide and unhide files or folders in macOS Finder using the terminal. This technique can help you keep your home directory organized and free from unnecessary clutter.