Wednesday, 11 June 2008

Hiding folders and files on Mac OS X (w/o XCode installed)

Imagine you want to hide some annoying folder or file, but apparently there's no "hidden" attribute to set in 'Get info' box (like on Windows). There's one tool which is able to help, it's called SetFile and is a part of Apple XCode developer toolkit. The latter is freely available to download on the Apple site, but, registration's needed to get the link and XCode weighs over 1Gb. Quick solution to do what you want is:

  1. Download standalone SetFile tool here or here

  2. Place (unzip if needed) into any folder (for ex., /Applications/Utilities/).

  3. Open Terminal and type (with your path to setfile): 

    chmod +x /Applications/Utilities/SetFile

    This will allow SetFile to execute.

  4. Then type:

    sudo /Applications/Utilities/SetFile -a V "/path/to/folder/"

    This will hide the folder or file you have entered the path of now.

To revert, type in the same command and replace "V" with "v". The hidden folder will stay visible in Terminal.