Make a file or folder hidden in Finder

Sometimes when we clone a Mac drive using unconventional methods, it works fine, but has an annoying side effect; Files that are usually hidden in the Finder are instead displayed and accessible to users. These files are hidden for a reason, and contain things like the UNIX system files and some Mac system files which you probably shouldn’t mess with.

Luckily there is a simple terminal command to make these files hidden again. It doesn’t delete them, just changes their file attributes.

sudo chflags hidden filename

sudo allows you to run commands as Super User so be careful! It will ask for a password (but not display it as you type…)

Where it says filename you can either replace it with a file or folder name, or drag a load of folders onto the terminal window and it will fill out the names for you.

An example below:

sudo chflags hidden /var

That would hide the var folder on the root of the boot drive.

I found this really helpful but as usual use it at your own risk…

Leave a Reply

Your email address will not be published. Required fields are marked *