I know I’ve written up telling OS X to show you invisible files, but what if you don’t want to make all invisible files show up, just make one file or folder go invisible, or for that matter, visible. Well, it’s easier than you might think. Apple has bundled a nice little command called chflags into the OS. To use it to hide a file, simply type chflags followed by hidden and then the folder. For example, let’s say you wanted to hide your ~/Library folder. Just run the following to hide it:
chflags hidden ~/Library
And then let’s say you wanted to unhide it ’cause you realized that it’s one of those folders best left visible:
chflags nohidden ~/Library
You can also use the SetFile command (both are located in /usr/bin, although chflags is included by default whereas SetFile is installed with the OS X Developer Tools). SetFile has a -a option and can set the v or V attribute to make a file shown or hidden respectively. Run the following command to make this same folder invisible:
SetFile -a V ~/Library
Or the following to make it visible:
SetFile -a v ~/Library
Oh, you can always throw a dot in front of a filename to hide it, but that’s not nearly as much fun…